summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLeaves.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-26 13:23:11 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-26 13:23:11 +0200
commitba36e79bc5fe44ac8752fa7cef3b06fbe8a01647 (patch)
tree6594840bd065c3342e947e6039df67ab07af9610 /src/Blocks/BlockLeaves.h
parentFix item durability. (diff)
parentGit: Ignore AllFiles.lst (generated by cmake) (diff)
downloadcuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.tar
cuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.tar.gz
cuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.tar.bz2
cuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.tar.lz
cuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.tar.xz
cuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.tar.zst
cuberite-ba36e79bc5fe44ac8752fa7cef3b06fbe8a01647.zip
Diffstat (limited to 'src/Blocks/BlockLeaves.h')
-rw-r--r--src/Blocks/BlockLeaves.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index 18f336225..972dd6232 100644
--- a/src/Blocks/BlockLeaves.h
+++ b/src/Blocks/BlockLeaves.h
@@ -40,14 +40,20 @@ public:
{
cFastRandom rand;
- // Only the first 2 bits contain the display information, the others are for growing
+ // Old leaves - 3 bits contain display; new leaves - 1st bit, shifted left two for saplings to understand
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))
+ )
+ );
}
// 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)
{