diff options
Diffstat (limited to 'nms-patches/BlockPiston.patch')
-rw-r--r-- | nms-patches/BlockPiston.patch | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/nms-patches/BlockPiston.patch b/nms-patches/BlockPiston.patch index e49c72f4..1e7d0100 100644 --- a/nms-patches/BlockPiston.patch +++ b/nms-patches/BlockPiston.patch @@ -1,34 +1,30 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/BlockPiston.java 2015-01-19 23:27:22.252538854 +0000 -+++ src/main/java/net/minecraft/server/BlockPiston.java 2015-01-19 23:27:22.252538854 +0000 -@@ -1,6 +1,17 @@ - package net.minecraft.server; +--- /home/matt/mc-dev-private//net/minecraft/server/BlockPiston.java 2015-02-26 22:40:22.195608144 +0000 ++++ src/main/java/net/minecraft/server/BlockPiston.java 2015-02-26 22:40:22.199608144 +0000 +@@ -2,6 +2,18 @@ + import java.util.List; + ++// CraftBukkit start +import java.util.AbstractList; +import java.util.Collection; +import java.util.Iterator; - import java.util.List; +import java.util.ListIterator; + -+// CraftBukkit start +import com.google.common.collect.ImmutableList; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.event.block.BlockPistonRetractEvent; +import org.bukkit.event.block.BlockPistonExtendEvent; +// CraftBukkit end - ++ public class BlockPiston extends Block { -@@ -52,10 +63,21 @@ - boolean flag = this.b(world, blockposition, enumdirection); - - if (flag && !((Boolean) iblockdata.get(BlockPiston.EXTENDED)).booleanValue()) { -- if ((new PistonExtendsChecker(world, blockposition, enumdirection, true)).a()) { -+ if ((new PistonExtendsChecker(world, blockposition, enumdirection, true)).a()) { + public static final BlockStateDirection FACING = BlockStateDirection.of("facing"); +@@ -56,6 +68,17 @@ world.playBlockAction(blockposition, this, 0, enumdirection.a()); } } else if (!flag && ((Boolean) iblockdata.get(BlockPiston.EXTENDED)).booleanValue()) { + // CraftBukkit start -+ if (!this.M) { ++ if (!this.N) { + org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.<org.bukkit.block.Block>of(), CraftBlock.notchToBlockFace(enumdirection)); + world.getServer().getPluginManager().callEvent(event); @@ -41,16 +37,16 @@ world.setTypeAndData(blockposition, iblockdata.set(BlockPiston.EXTENDED, Boolean.valueOf(false)), 2); world.playBlockAction(blockposition, this, 1, enumdirection.a()); } -@@ -146,7 +168,7 @@ +@@ -146,7 +169,7 @@ } } -- if (!flag1 && block.getMaterial() != Material.AIR && a(block, world, blockposition1, enumdirection.opposite(), false) && (block.i() == 0 || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { -+ if (!flag1 && a(block, world, blockposition1, enumdirection.opposite(), false) && (block.i() == 0 || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { // CraftBukkit - remove 'block.getMaterial() != Material.AIR' condition +- if (!flag1 && block.getMaterial() != Material.AIR && a(block, world, blockposition1, enumdirection.opposite(), false) && (block.k() == 0 || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { ++ if (!flag1 && a(block, world, blockposition1, enumdirection.opposite(), false) && (block.k() == 0 || block == Blocks.PISTON || block == Blocks.STICKY_PISTON)) { // CraftBukkit - remove 'block.getMaterial() != Material.AIR' condition this.a(world, blockposition, enumdirection, false); } } else { -@@ -286,10 +308,46 @@ +@@ -286,10 +309,46 @@ if (!pistonextendschecker.a()) { return false; } else { |