diff options
author | feildmaster <admin@feildmaster.com> | 2012-08-04 03:07:27 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-08-04 04:10:55 -0500 |
commit | 823e3fb0c6cd03a3142fdf28438e82969eab4552 (patch) | |
tree | 24e0c17c813602978743867ed0dc20a95ff29baf | |
parent | ab8b7c7e33e804ec644017be847d329a297cf307 (diff) | |
download | craftbukkit-823e3fb0c6cd03a3142fdf28438e82969eab4552.tar craftbukkit-823e3fb0c6cd03a3142fdf28438e82969eab4552.tar.gz craftbukkit-823e3fb0c6cd03a3142fdf28438e82969eab4552.tar.lz craftbukkit-823e3fb0c6cd03a3142fdf28438e82969eab4552.tar.xz craftbukkit-823e3fb0c6cd03a3142fdf28438e82969eab4552.zip |
Correctly detect invalid PistonExtension's to allow removal of StickyPistons. Fixes BUKKIT-2059
-rw-r--r-- | src/main/java/net/minecraft/server/BlockPistonExtension.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/BlockPistonExtension.java b/src/main/java/net/minecraft/server/BlockPistonExtension.java index 28967175..19ec8d5d 100644 --- a/src/main/java/net/minecraft/server/BlockPistonExtension.java +++ b/src/main/java/net/minecraft/server/BlockPistonExtension.java @@ -15,7 +15,7 @@ public class BlockPistonExtension extends Block { public void remove(World world, int i, int j, int k, int l, int i1) { super.remove(world, i, j, k, l, i1); - if (i1 > 5 || i1 < 0) return; // CraftBukkit - fixed a piston AIOOBE issue + if ((i1 & 7) >= Facing.OPPOSITE_FACING.length) return; // CraftBukkit - fixed a piston AIOOBE issue int j1 = Facing.OPPOSITE_FACING[f(i1)]; i += Facing.b[j1]; @@ -142,7 +142,7 @@ public class BlockPistonExtension extends Block { public void doPhysics(World world, int i, int j, int k, int l) { int i1 = f(world.getData(i, j, k)); - if (i1 > 5 || i1 < 0) return; // CraftBukkit - fixed a piston AIOOBE issue + if ((i1 & 7) >= Facing.OPPOSITE_FACING.length) return; // CraftBukkit - fixed a piston AIOOBE issue int j1 = world.getTypeId(i - Facing.b[i1], j - Facing.c[i1], k - Facing.d[i1]); if (j1 != Block.PISTON.id && j1 != Block.PISTON_STICKY.id) { |