summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLeaves.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-04-18 12:30:23 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-04-22 23:30:00 +0200
commit7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04 (patch)
tree755a1e62f0b67ac4c8d059145a9e082d0cb11876 /src/Blocks/BlockLeaves.h
parentMerge pull request #3048 from Woazboat/minecarts (diff)
downloadcuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.tar
cuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.tar.gz
cuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.tar.bz2
cuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.tar.lz
cuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.tar.xz
cuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.tar.zst
cuberite-7f5757eccff7b81c17443ea4e0b4ce86e2d5dc04.zip
Diffstat (limited to 'src/Blocks/BlockLeaves.h')
-rw-r--r--src/Blocks/BlockLeaves.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index 653fd19bb..84e186b4c 100644
--- a/src/Blocks/BlockLeaves.h
+++ b/src/Blocks/BlockLeaves.h
@@ -75,11 +75,12 @@ public:
virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) override
{
- // Unset 0x8 bit so this block gets checked for decay:
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- if ((Meta & 0x08) != 0)
+
+ // Set 0x8 bit so this block gets checked for decay:
+ if ((Meta & 0x08) == 0)
{
- a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7, false, false);
+ a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta | 0x8, true, false);
}
}
@@ -92,7 +93,7 @@ public:
return;
}
- if ((Meta & 0x8) != 0)
+ if ((Meta & 0x8) == 0)
{
// These leaves have been checked for decay lately and nothing around them changed
return;
@@ -116,10 +117,8 @@ public:
if (HasNearLog(Area, BlockX, a_RelY, BlockZ))
{
- // Wood found, the leaves stay; mark them as checked.
- // There is no point in saving this to disk or informing the client
- // So we use SetMetaQuiet
- a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta | 0x8, false, false);
+ // Wood found, the leaves stay; unset the check bit
+ a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta ^ 0x8, true, false);
return;
}