diff options
author | Tahg <tahgtahv@gmail.com> | 2011-09-21 04:26:05 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-09-21 04:26:05 -0400 |
commit | 75e18f304aa8af1ed3290bc60f54455d3148509d (patch) | |
tree | 7ef9cb5a01f22ad74920aa429db5edea70a23a88 /src/main/java/net/minecraft/server/TileEntityChest.java | |
parent | d06d111b94ec0041bed667d0a7b34e227759959b (diff) | |
download | craftbukkit-75e18f304aa8af1ed3290bc60f54455d3148509d.tar craftbukkit-75e18f304aa8af1ed3290bc60f54455d3148509d.tar.gz craftbukkit-75e18f304aa8af1ed3290bc60f54455d3148509d.tar.lz craftbukkit-75e18f304aa8af1ed3290bc60f54455d3148509d.tar.xz craftbukkit-75e18f304aa8af1ed3290bc60f54455d3148509d.zip |
better chest fix
Diffstat (limited to 'src/main/java/net/minecraft/server/TileEntityChest.java')
-rw-r--r-- | src/main/java/net/minecraft/server/TileEntityChest.java | 32 |
1 files changed, 13 insertions, 19 deletions
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); } |