diff options
author | worktycho <work.tycho@gmail.com> | 2015-07-01 11:39:46 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-07-01 11:39:46 +0200 |
commit | 11cf88b8722e55e5ab3e1775b62538e96575b600 (patch) | |
tree | 6b16a888c3abce218cd76a719312811a63f0e5f6 /src/Blocks/BlockLeaves.h | |
parent | APIDump: Fixed a forgotten comma. (diff) | |
parent | Added neighbor specification in the OnNeighborChanged() block callback. (diff) | |
download | cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.tar cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.tar.gz cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.tar.bz2 cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.tar.lz cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.tar.xz cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.tar.zst cuberite-11cf88b8722e55e5ab3e1775b62538e96575b600.zip |
Diffstat (limited to 'src/Blocks/BlockLeaves.h')
-rw-r--r-- | src/Blocks/BlockLeaves.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h index 5c9283979..2368eab7b 100644 --- a/src/Blocks/BlockLeaves.h +++ b/src/Blocks/BlockLeaves.h @@ -75,10 +75,14 @@ public: } - virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override + 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); - a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7); // Unset 0x8 bit so it gets checked for decay + if ((Meta & 0x08) != 0) + { + a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7); + } } |