1
0
forked from xjboss/KCauldronX
KCauldronX/patches/net/minecraft/tileentity/TileEntity.java.patch

69 lines
2.4 KiB
Diff
Raw Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java
@@ -22,18 +22,22 @@
2015-03-22 17:38:04 +00:00
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.spigotmc.CustomTimingsHandler; // Spigot
+import org.bukkit.inventory.InventoryHolder; // CraftBukkit
+
public class TileEntity
{
private static final Logger logger = LogManager.getLogger();
private static Map nameToClassMap = new HashMap();
- private static Map classToNameMap = new HashMap();
- protected World worldObj;
+ public static Map classToNameMap = new HashMap(); // Cauldron - private -> public
+ public World worldObj; // CraftBukkit - protected -> public
public int xCoord;
public int yCoord;
public int zCoord;
protected boolean tileEntityInvalid;
public int blockMetadata = -1;
public Block blockType;
+ public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
private static final String __OBFID = "CL_00000340";
public static void addMapping(Class p_145826_0_, String p_145826_1_)
@@ -106,7 +110,11 @@
2015-03-22 17:38:04 +00:00
}
catch (Exception exception)
{
- exception.printStackTrace();
+ // Cauldron start - better debug
+ FMLLog.log(Level.ERROR, exception,
+ "A TileEntity %s(%s) located @ %s,%s,%s has thrown an exception during creation, it cannot be created. Report this to the mod author",
+ p_145827_0_.getString("id"), oclass.getName(), p_145827_0_.getInteger("x"), p_145827_0_.getInteger("y"), p_145827_0_.getInteger("z"));
+ // Cauldron end
}
if (tileentity != null)
@@ -282,6 +290,20 @@
2015-03-22 17:38:04 +00:00
addMapping(TileEntityFlowerPot.class, "FlowerPot");
}
+ // CraftBukkit start
+ public InventoryHolder getOwner()
+ {
+ org.bukkit.block.BlockState state = worldObj.getWorld().getBlockAt(xCoord, yCoord, zCoord).getState();
+
+ if (state instanceof InventoryHolder)
+ {
+ return (InventoryHolder) state;
+ }
+
+ return null;
+ }
+ // CraftBukkit end
+
// -- BEGIN FORGE PATCHES --
/**
* Determines if this TileEntity requires update calls.
@@ -370,4 +392,6 @@
}
return bb;
}
+
+ public boolean dead;
}