summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-07-26 15:15:00 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-07-26 15:16:46 +0200
commit4e5ab02a589582e2fa908909e3ee30360dd08be5 (patch)
tree848bb5338a5c5e52168702ee78058a6cc76f867f /src/Blocks
parentFix incorrect big flower translation (diff)
downloadcuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.tar
cuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.tar.gz
cuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.tar.bz2
cuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.tar.lz
cuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.tar.xz
cuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.tar.zst
cuberite-4e5ab02a589582e2fa908909e3ee30360dd08be5.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockComparator.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/Blocks/BlockComparator.h b/src/Blocks/BlockComparator.h
index a2f2d430d..ba939b41f 100644
--- a/src/Blocks/BlockComparator.h
+++ b/src/Blocks/BlockComparator.h
@@ -34,10 +34,13 @@ public:
const Vector3i a_CursorPos
) override
{
+ const auto Meta = a_ChunkInterface.GetBlockMeta(a_BlockPos);
+
// Toggle the 3rd bit (addition / subtraction):
- NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockPos);
- Meta ^= 0x04;
- a_ChunkInterface.SetBlockMeta(a_BlockPos, Meta);
+ a_ChunkInterface.SetBlockMeta(a_BlockPos, Meta ^ 0x04);
+
+ // Update simulators:
+ a_WorldInterface.WakeUpSimulators(a_BlockPos);
return true;
}
@@ -56,6 +59,7 @@ public:
UNUSED(a_ChunkInterface);
UNUSED(a_BlockFace);
+ a_WorldInterface.WakeUpSimulators(a_BlockPos);
a_WorldInterface.SendBlockTo(a_BlockPos, a_Player);
}
@@ -120,15 +124,6 @@ public:
- inline static bool IsOn(NIBBLETYPE a_Meta)
- {
- return ((a_Meta & 0x8) == 0x8);
- }
-
-
-
-
-
inline static Vector3i GetSideCoordinate(Vector3i a_Position, NIBBLETYPE a_Meta, bool a_bInverse)
{
if (!a_bInverse)