You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.3 KiB
61 lines
2.3 KiB
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java |
|
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java |
|
@@ -22,18 +22,22 @@ |
|
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 @@ |
|
} |
|
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 @@ |
|
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.
|
|
|