From 300a2a1dafa8ffbf49e0d87a281247ed06a946bb Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 20 Jul 2018 10:59:23 +1000 Subject: [PATCH] SPIGOT-4064: Fix BlockPistonRetractEvent for regular pistons By: md_5 --- paper-server/nms-patches/BlockPiston.patch | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/paper-server/nms-patches/BlockPiston.patch b/paper-server/nms-patches/BlockPiston.patch index ae8fcc83a6..7b08e4bd4f 100644 --- a/paper-server/nms-patches/BlockPiston.patch +++ b/paper-server/nms-patches/BlockPiston.patch @@ -19,25 +19,25 @@ public class BlockPiston extends BlockDirectional { public static final BlockStateBoolean EXTENDED = BlockProperties.f; -@@ -109,6 +121,18 @@ - b0 = 2; - } +@@ -111,6 +123,18 @@ } -+ // CraftBukkit start -+ if (!this.sticky) { -+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(enumdirection)); -+ world.getServer().getPluginManager().callEvent(event); -+ -+ if (event.isCancelled()) { -+ return; -+ } -+ } -+ // PAIL: checkME - what happened to setTypeAndData? -+ // CraftBukkit end } ++ // CraftBukkit start ++ if (!this.sticky) { ++ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(enumdirection)); ++ world.getServer().getPluginManager().callEvent(event); ++ ++ if (event.isCancelled()) { ++ return; ++ } ++ } ++ // PAIL: checkME - what happened to setTypeAndData? ++ // CraftBukkit end world.playBlockAction(blockposition, this, b0, enumdirection.a()); + } + @@ -271,6 +295,48 @@ IBlockData[] aiblockdata = new IBlockData[j]; EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite();