From a43d621c0138110d2ec362b2eaa8f938f241bb49 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Sun, 29 Jul 2012 02:33:13 -0500 Subject: Update CraftBukkit to Minecraft 1.3.1 --- src/main/java/net/minecraft/server/TileEntity.java | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'src/main/java/net/minecraft/server/TileEntity.java') diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java index d569ed8c..869e03c2 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -3,15 +3,13 @@ package net.minecraft.server; import java.util.HashMap; import java.util.Map; -// CraftBukkit start -import org.bukkit.inventory.InventoryHolder; -// CraftBukkit end +import org.bukkit.inventory.InventoryHolder; // CraftBukkit public class TileEntity { private static Map a = new HashMap(); private static Map b = new HashMap(); - public World world; + protected World world; public int x; public int y; public int z; @@ -22,7 +20,7 @@ public class TileEntity { public TileEntity() {} private static void a(Class oclass, String s) { - if (b.containsKey(s)) { + if (a.containsKey(s)) { throw new IllegalArgumentException("Duplicate id: " + s); } else { a.put(s, oclass); @@ -30,6 +28,14 @@ public class TileEntity { } } + public void a(World world) { + this.world = world; + } + + public boolean m() { + return this.world != null; + } + public void a(NBTTagCompound nbttagcompound) { this.x = nbttagcompound.getInt("x"); this.y = nbttagcompound.getInt("y"); @@ -49,7 +55,7 @@ public class TileEntity { } } - public void q_() {} + public void g() {} public static TileEntity c(NBTTagCompound nbttagcompound) { TileEntity tileentity = null; @@ -73,7 +79,7 @@ public class TileEntity { return tileentity; } - public int k() { + public int n() { if (this.p == -1) { this.p = this.world.getData(this.x, this.y, this.z); } @@ -88,11 +94,11 @@ public class TileEntity { } } - public Packet d() { + public Packet e() { return null; } - public boolean l() { + public boolean p() { return this.o; } @@ -100,7 +106,7 @@ public class TileEntity { this.o = true; } - public void m() { + public void q() { this.o = false; } @@ -114,6 +120,7 @@ public class TileEntity { static { a(TileEntityFurnace.class, "Furnace"); a(TileEntityChest.class, "Chest"); + a(TileEntityEnderChest.class, "EnderChest"); a(TileEntityRecordPlayer.class, "RecordPlayer"); a(TileEntityDispenser.class, "Trap"); a(TileEntitySign.class, "Sign"); @@ -128,7 +135,7 @@ public class TileEntity { // CraftBukkit start public InventoryHolder getOwner() { org.bukkit.block.BlockState state = world.getWorld().getBlockAt(x, y, z).getState(); - if(state instanceof InventoryHolder) return (InventoryHolder) state; + if (state instanceof InventoryHolder) return (InventoryHolder) state; return null; } // CraftBukkit end -- cgit v1.2.3