summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-12-13 13:22:28 +0100
committerHowaner <franzi.moos@googlemail.com>2014-12-13 13:22:28 +0100
commita08d5f1a39d740766aa1afb6a74dd479a9b25a35 (patch)
tree7f80dc97829ee4a13b135754f6ccaa307ec90a0b
parentFixed grass spread (diff)
downloadcuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.tar
cuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.tar.gz
cuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.tar.bz2
cuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.tar.lz
cuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.tar.xz
cuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.tar.zst
cuberite-a08d5f1a39d740766aa1afb6a74dd479a9b25a35.zip
-rw-r--r--src/Blocks/BlockLeaves.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index bd9a7414e..db3d682a1 100644
--- a/src/Blocks/BlockLeaves.h
+++ b/src/Blocks/BlockLeaves.h
@@ -38,10 +38,15 @@ public:
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
- cFastRandom rand;
+ cFastRandom Rand;
+ int DropChance = 20;
+ if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_JUNGLE))
+ {
+ DropChance = 40;
+ }
// Old leaves - 3 bits contain display; new leaves - 1st bit, shifted left two for saplings to understand
- if (rand.NextInt(6) == 0)
+ if (Rand.NextInt(DropChance) == 0)
{
a_Pickups.push_back(
cItem(
@@ -52,10 +57,10 @@ public:
);
}
- // 1 % chance of dropping an apple, if the leaves' type is Apple Leaves
+ // 0.5 % chance of dropping an apple, if the leaves' type is Apple Leaves
if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_APPLE))
{
- if (rand.NextInt(101) == 0)
+ if (Rand.NextInt(200) == 0)
{
a_Pickups.push_back(cItem(E_ITEM_RED_APPLE, 1, 0));
}