From 2dba592dc48f22dae6394dd329ed698b7d2b1876 Mon Sep 17 00:00:00 2001 From: Tahg Date: Thu, 2 Feb 2012 07:54:51 -0500 Subject: [PATCH] Remove tile entities when a block is removed. --- src/main/java/net/minecraft/server/Chunk.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 0bb437d07c..a550bc4c7b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -311,8 +311,11 @@ public class Chunk { if (l1 != 0) { if (!this.world.isStatic) { Block.byId[l1].remove(this.world, i2, j, j2); - } else if (Block.byId[l1] instanceof BlockContainer && l1 != l) { - this.world.n(i2, j, j2); + // CraftBukkit start - delete tile entities for removed blocks + if (Block.byId[l1] instanceof BlockContainer) { + this.world.n(i2, j, j2); + } + // CraftBukkit end } } @@ -384,6 +387,11 @@ public class Chunk { this.b[i << this.world.heightBitsPlusFour | k << this.world.heightBits | j] = (byte) (b0 & 255); if (k1 != 0) { Block.byId[k1].remove(this.world, l1, j, i2); + // CraftBukkit start - delete tile entities for removed blocks + if (Block.byId[k1] instanceof BlockContainer) { + this.world.n(l1, j, i2); + } + // CraftBukkit end } this.g.a(i, j, k, 0);