From 0bde47a173dacd155da3f0715abfcba9455e0f17 Mon Sep 17 00:00:00 2001 From: John Driscoll Date: Wed, 8 Aug 2012 00:42:18 -0700 Subject: [PATCH] Don't extend pistons until data is set. Fixes BUKKIT-2153 --- src/main/java/net/minecraft/server/BlockPiston.java | 2 +- src/main/java/net/minecraft/server/Chunk.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java index 3bf3752ab8..2944eca761 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -55,7 +55,7 @@ public class BlockPiston extends Block { public void onPlace(World world, int i, int j, int k) { if (!world.isStatic && world.getTileEntity(i, j, k) == null) { - // this.l(world, i, j, k); // CraftBukkit - don't extend arm of piston that doesn't exist + this.l(world, i, j, k); } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 31cdcd5547..192cd6f17b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -417,7 +417,11 @@ public class Chunk { if (l != 0) { if (!this.world.isStatic) { - Block.byId[l].onPlace(this.world, j2, j, k2); + // CraftBukkit start - Don't extend piston until data is set + if (!(Block.byId[l] instanceof BlockPiston) || i2 != 0) { + Block.byId[l].onPlace(this.world, j2, j, k2); + } + // CraftBukkit end } if (Block.byId[l] instanceof BlockContainer) {