summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockTallGrass.h
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2020-09-28 14:41:49 +0200
committerGitHub <noreply@github.com>2020-09-28 14:41:49 +0200
commit8eca58a1c9d3ea928b301de1ad772a46164372e1 (patch)
tree9627cfb9c43ed9b332a493c474e7ebe119543b89 /src/Blocks/BlockTallGrass.h
parentEnchanting consumes lapis, removes correct number of levels (#4934) (diff)
downloadcuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.gz
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.bz2
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.lz
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.xz
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.tar.zst
cuberite-8eca58a1c9d3ea928b301de1ad772a46164372e1.zip
Diffstat (limited to 'src/Blocks/BlockTallGrass.h')
-rw-r--r--src/Blocks/BlockTallGrass.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Blocks/BlockTallGrass.h b/src/Blocks/BlockTallGrass.h
index f0da32cf5..d43d3ad04 100644
--- a/src/Blocks/BlockTallGrass.h
+++ b/src/Blocks/BlockTallGrass.h
@@ -37,12 +37,15 @@ private:
return cItem(m_BlockType, 1, a_BlockMeta);
}
- // Drop seeds, sometimes:
- if (GetRandomProvider().RandBool(0.125))
+ // Drop seeds, depending on bernoulli trial result:
+ if (GetRandomProvider().RandBool(0.875)) // 87.5% chance of dropping nothing
{
- return cItem(E_ITEM_SEEDS);
+ return {};
}
- return {};
+
+ // 12.5% chance of dropping 0 or more seeds.
+ const auto DropNum = FortuneDiscreteRandom(1, 1, 2 * ToolFortuneLevel(a_Tool));
+ return cItem(E_ITEM_SEEDS, DropNum);
}