diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-22 21:10:02 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-22 21:10:02 +0200 |
commit | b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5 (patch) | |
tree | 089b3be905aa030367925762c58bd30b08f5f3f6 /src/Blocks/BlockLeaves.h | |
parent | Updated prefabs to current Gallery content. (diff) | |
parent | Merge remote-tracking branch 'origin/master' into saplingsandleaves (diff) | |
download | cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.gz cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.bz2 cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.lz cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.xz cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.zst cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.zip |
Diffstat (limited to 'src/Blocks/BlockLeaves.h')
-rw-r--r-- | src/Blocks/BlockLeaves.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h index 797824506..1635eba08 100644 --- a/src/Blocks/BlockLeaves.h +++ b/src/Blocks/BlockLeaves.h @@ -43,11 +43,17 @@ public: // Only the first 2 bits contain the display information, the others are for growing if (rand.NextInt(6) == 0) { - a_Pickups.push_back(cItem(E_BLOCK_SAPLING, 1, a_BlockMeta & 3)); + a_Pickups.push_back( + cItem( + E_BLOCK_SAPLING, + 1, + (m_BlockType == E_BLOCK_LEAVES) ? (a_BlockMeta & 0x03) : (2 << (a_BlockMeta & 0x01)) // Old leaves - 3 bits contain display; new leaves - 1st bit, shifted left two for saplings to understand + ) + ); } // 1 % chance of dropping an apple, if the leaves' type is Apple Leaves - if ((a_BlockMeta & 3) == E_META_LEAVES_APPLE) + if ((m_BlockType == E_BLOCK_LEAVES) && ((a_BlockMeta & 0x03) == E_META_LEAVES_APPLE)) { if (rand.NextInt(101) == 0) { |