summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLeaves.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-17 23:26:53 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-17 23:26:53 +0200
commit0f8c24e04d60aa1642a5fe7346941ccd7697977e (patch)
tree4b62903944643bfe406f503393bc26815c2548a7 /src/Blocks/BlockLeaves.h
parentFixed mob knockback (diff)
downloadcuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.tar
cuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.tar.gz
cuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.tar.bz2
cuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.tar.lz
cuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.tar.xz
cuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.tar.zst
cuberite-0f8c24e04d60aa1642a5fe7346941ccd7697977e.zip
Diffstat (limited to 'src/Blocks/BlockLeaves.h')
-rw-r--r--src/Blocks/BlockLeaves.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index 495e849fa..67c4535b8 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)
{