Archiviert
13
0

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

Dieser Commit ist enthalten in:
Thinkofdeath 2014-12-05 15:11:22 +00:00
Ursprung 3f6a1db4f6
Commit 0d4fba2c14

Datei anzeigen

@ -1,5 +1,5 @@
--- ../work/decompile-8eb82bde//net/minecraft/server/BlockPiston.java 2014-11-28 17:43:42.933707439 +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-11-28 17:38:20.000000000 +0000 +++ src/main/java/net/minecraft/server/BlockPiston.java 2014-12-05 15:10:54.834252765 +0000
@@ -1,6 +1,16 @@ @@ -1,6 +1,16 @@
package net.minecraft.server; package net.minecraft.server;
@ -38,7 +38,7 @@
world.setTypeAndData(blockposition, iblockdata.set(BlockPiston.EXTENDED, Boolean.valueOf(false)), 2); world.setTypeAndData(blockposition, iblockdata.set(BlockPiston.EXTENDED, Boolean.valueOf(false)), 2);
world.playBlockAction(blockposition, this, 1, enumdirection.a()); world.playBlockAction(blockposition, this, 1, enumdirection.a());
} }
@@ -286,6 +305,35 @@ @@ -286,10 +305,40 @@
if (!pistonextendschecker.a()) { if (!pistonextendschecker.a()) {
return false; return false;
} else { } 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); + world.getServer().getPluginManager().callEvent(event);
+ +
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
int i = list.size() + list1.size(); +
Block[] ablock = new Block[i]; int j;
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.opposite(); BlockPosition blockposition1;