summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorTahg <tahgtahv@gmail.com>2011-09-21 05:01:44 -0400
committerTahg <tahgtahv@gmail.com>2011-09-21 05:01:44 -0400
commitf6ab0f8611b14fa1ac426ac416719a07d4a7b4bd (patch)
tree352004fc16558145b8076c3121babf7646e50536 /src/main/java/net/minecraft/server
parent75e18f304aa8af1ed3290bc60f54455d3148509d (diff)
downloadcraftbukkit-f6ab0f8611b14fa1ac426ac416719a07d4a7b4bd.tar
craftbukkit-f6ab0f8611b14fa1ac426ac416719a07d4a7b4bd.tar.gz
craftbukkit-f6ab0f8611b14fa1ac426ac416719a07d4a7b4bd.tar.lz
craftbukkit-f6ab0f8611b14fa1ac426ac416719a07d4a7b4bd.tar.xz
craftbukkit-f6ab0f8611b14fa1ac426ac416719a07d4a7b4bd.zip
more chest checks
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/TileEntityChest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index 3faa3702..ba09f8e7 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -103,6 +103,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
}
public boolean a(EntityHuman entityhuman) {
+ if (this.world == null) return true; // CraftBukkit
return this.world.getTileEntity(this.x, this.y, this.z) != this ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
}
@@ -114,6 +115,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
public void h() {
if (!this.a) {
// CraftBukkit start
+ if (this.world == null) return; // CraftBukkit
TileEntityChest otherChest = null;
BlockChest chest = (BlockChest) Block.byId[Block.CHEST.id];
chest.b(this.world, this.x, this.y, this.z);
@@ -148,6 +150,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
// CraftBukkit start
private TileEntityChest getTileEntity(int x, int y, int z) {
+ if (this.world == null) return null; // CraftBukkit
TileEntity entity = this.world.getTileEntity(x, y, z);
if (entity instanceof TileEntityChest) {
@@ -165,6 +168,7 @@ public class TileEntityChest extends TileEntity implements IInventory {
public void h_() {
super.h_();
+ if (this.world == null) return; // CraftBukkit
this.h();
if (++this.q % (20 * 4) == 0) { // CraftBukkit
this.world.playNote(this.x, this.y, this.z, 1, this.h);
@@ -227,11 +231,13 @@ public class TileEntityChest extends TileEntity implements IInventory {
public void e() {
++this.h;
+ if (this.world == null) return; // CraftBukkit
this.world.playNote(this.x, this.y, this.z, 1, this.h);
}
public void t_() {
--this.h;
+ if (this.world == null) return; // CraftBukkit
this.world.playNote(this.x, this.y, this.z, 1, this.h);
}