From 0d4fba2c14b764452033cbf5f452a92a9a2c4d7c Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Fri, 5 Dec 2014 15:11:22 +0000 Subject: [PATCH] SPIGOT-117: Fix sticky pistons firing for the wrong direction when pulling blocks backwards --- nms-patches/BlockPiston.patch | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/nms-patches/BlockPiston.patch b/nms-patches/BlockPiston.patch index 70fac0b837..fb9b9e0944 100644 --- a/nms-patches/BlockPiston.patch +++ b/nms-patches/BlockPiston.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/BlockPiston.java 2014-11-28 17:43:42.933707439 +0000 -+++ src/main/java/net/minecraft/server/BlockPiston.java 2014-11-28 17:38:20.000000000 +0000 +--- ../work/decompile-8eb82bde//net/minecraft/server/BlockPiston.java 2014-12-05 15:10:57.106252715 +0000 ++++ src/main/java/net/minecraft/server/BlockPiston.java 2014-12-05 15:10:54.834252765 +0000 @@ -1,6 +1,16 @@ package net.minecraft.server; @@ -38,7 +38,7 @@ world.setTypeAndData(blockposition, iblockdata.set(BlockPiston.EXTENDED, Boolean.valueOf(false)), 2); world.playBlockAction(blockposition, this, 1, enumdirection.a()); } -@@ -286,6 +305,35 @@ +@@ -286,10 +305,40 @@ if (!pistonextendschecker.a()) { return false; } else { @@ -64,13 +64,18 @@ + } + }; + -+ BlockPistonExtendEvent event = new BlockPistonExtendEvent(bblock, blocks, CraftBlock.notchToBlockFace(enumdirection)); + int i = list.size() + list1.size(); + Block[] ablock = new Block[i]; + EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite(); + ++ BlockPistonExtendEvent event = new BlockPistonExtendEvent(bblock, blocks, CraftBlock.notchToBlockFace(enumdirection1)); + world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return false; + } + // CraftBukkit end - int i = list.size() + list1.size(); - Block[] ablock = new Block[i]; - EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite(); ++ + int j; + BlockPosition blockposition1; +