SPIGOT-117: Fix sticky pistons firing for the wrong direction when pulling blocks backwards

This commit is contained in:
Thinkofdeath 2014-12-05 15:11:22 +00:00
parent 3f6a1db4f6
commit 0d4fba2c14

View file

@ -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;