From 75e18f304aa8af1ed3290bc60f54455d3148509d Mon Sep 17 00:00:00 2001 From: Tahg Date: Wed, 21 Sep 2011 04:26:05 -0400 Subject: better chest fix --- .../java/net/minecraft/server/TileEntityChest.java | 32 +++++++++------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'src/main/java/net/minecraft/server/TileEntityChest.java') diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java index 0616be18..3faa3702 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -113,42 +113,36 @@ public class TileEntityChest extends TileEntity implements IInventory { public void h() { if (!this.a) { + // CraftBukkit start + TileEntityChest otherChest = null; + BlockChest chest = (BlockChest) Block.byId[Block.CHEST.id]; + chest.b(this.world, this.x, this.y, this.z); this.a = true; this.b = null; this.c = null; this.d = null; this.e = null; if (this.world.getTypeId(this.x - 1, this.y, this.z) == Block.CHEST.id) { - this.d = getTileEntity(this.x - 1, this.y, this.z); // CraftBukkit + otherChest = this.d = getTileEntity(this.x - 1, this.y, this.z); // CraftBukkit } if (this.world.getTypeId(this.x + 1, this.y, this.z) == Block.CHEST.id) { - this.c = getTileEntity(this.x + 1, this.y, this.z); // CraftBukkit + otherChest = this.c = getTileEntity(this.x + 1, this.y, this.z); // CraftBukkit } if (this.world.getTypeId(this.x, this.y, this.z - 1) == Block.CHEST.id) { - this.b = getTileEntity(this.x, this.y, this.z - 1); // CraftBukkit + otherChest = this.b = getTileEntity(this.x, this.y, this.z - 1); // CraftBukkit } if (this.world.getTypeId(this.x, this.y, this.z + 1) == Block.CHEST.id) { - this.e = getTileEntity(this.x, this.y, this.z + 1); // CraftBukkit + otherChest = this.e = getTileEntity(this.x, this.y, this.z + 1); // CraftBukkit } - if (this.b != null) { - this.b.g(); - } - - if (this.e != null) { - this.e.g(); - } - - if (this.c != null) { - this.c.g(); - } - - if (this.d != null) { - this.d.g(); + if (otherChest != null) { + otherChest.g(); + chest.b(otherChest.world, otherChest.x, otherChest.y, otherChest.z); } + // CraftBukkit end } } @@ -172,7 +166,7 @@ public class TileEntityChest extends TileEntity implements IInventory { public void h_() { super.h_(); this.h(); - if (++this.q % 20 * 4 == 0) { + if (++this.q % (20 * 4) == 0) { // CraftBukkit this.world.playNote(this.x, this.y, this.z, 1, this.h); } -- cgit v1.2.3