From 641ecc4f342ac13fcf3e3c5e89d60a7ba221bdd4 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Wed, 23 Jan 2013 06:15:21 -0600 Subject: [PATCH] Return the valid max value for piston direction. Fixes BUKKIT-2191 By returning the following value (7) we remove the need to special case pistons in any way (other than the original purpose of this check, which is to ensure pistons have valid data) --- src/main/java/net/minecraft/server/BlockPiston.java | 2 +- src/main/java/net/minecraft/server/Chunk.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java index 3e5465b601..0f1b5e584e 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -217,7 +217,7 @@ public class BlockPiston extends Block { } public static int e(int i) { - if ((i & 7) >= Facing.OPPOSITE_FACING.length) return 0; // CraftBukkit - check for AIOOB on piston data + if ((i & 7) >= Facing.OPPOSITE_FACING.length) return 7; // CraftBukkit - check for AIOOB on piston data return i & 7; } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 06e3d96214..941a4c2231 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -429,8 +429,8 @@ public class Chunk { if (l != 0) { if (!this.world.isStatic) { - // CraftBukkit start - Don't extend piston until data is set, don't "place" if we're processing the event - if (!this.world.suppressPhysics && (!(Block.byId[l] instanceof BlockPiston) || i2 != 0)) { + // CraftBukkit start - Don't "place" if we're processing the event + if (!this.world.suppressPhysics) { Block.byId[l].onPlace(this.world, j2, j, k2); } // CraftBukkit end