summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPiston.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2020-04-03 22:24:49 +0200
committerGitHub <noreply@github.com>2020-04-03 22:24:49 +0200
commitba048e2101d42af53f2ac7a9a3ed04c194918136 (patch)
tree169c0e1f5f0cd306feadc00fd82b3079babf3088 /src/Blocks/BlockPiston.cpp
parentQuick fix to make spawn eggs work (#4611) (diff)
downloadcuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar
cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.gz
cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.bz2
cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.lz
cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.xz
cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.tar.zst
cuberite-ba048e2101d42af53f2ac7a9a3ed04c194918136.zip
Diffstat (limited to 'src/Blocks/BlockPiston.cpp')
-rw-r--r--src/Blocks/BlockPiston.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Blocks/BlockPiston.cpp b/src/Blocks/BlockPiston.cpp
index 5a18cffac..8c6940454 100644
--- a/src/Blocks/BlockPiston.cpp
+++ b/src/Blocks/BlockPiston.cpp
@@ -297,9 +297,10 @@ void cBlockPistonHandler::RetractPiston(Vector3i a_BlockPos, cWorld & a_World)
return;
}
- // Remove extension, update base state
- World.SetBlock(extensionPos.x, extensionPos.y, extensionPos.z, E_BLOCK_AIR, 0);
- World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, pistonBlock, pistonMeta & ~(8));
+ // Remove extension, update base state. Calling FastSetBlock inhibits OnBroken being called by SetBlock.
+ World.FastSetBlock(extensionPos, E_BLOCK_AIR, 0);
+ World.SetBlock(extensionPos, E_BLOCK_AIR, 0);
+ World.SetBlock(a_BlockPos, pistonBlock, pistonMeta & ~(8));
// (Retraction is always successful, but play in the task for consistency)
World.BroadcastSoundEffect("block.piston.contract", a_BlockPos, 0.5f, 0.7f);