summaryrefslogtreecommitdiffstats
path: root/nms-patches/TileEntity.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/TileEntity.patch')
-rw-r--r--nms-patches/TileEntity.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/nms-patches/TileEntity.patch b/nms-patches/TileEntity.patch
new file mode 100644
index 00000000..dd76aea1
--- /dev/null
+++ b/nms-patches/TileEntity.patch
@@ -0,0 +1,24 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/TileEntity.java 2014-11-27 08:59:46.913420913 +1100
++++ src/main/java/net/minecraft/server/TileEntity.java 2014-11-27 08:42:10.148850918 +1100
+@@ -6,6 +6,8 @@
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+
++import org.bukkit.inventory.InventoryHolder; // CraftBukkit
++
+ public abstract class TileEntity {
+
+ private static final Logger a = LogManager.getLogger();
+@@ -182,4 +184,12 @@
+ a(TileEntityFlowerPot.class, "FlowerPot");
+ a(TileEntityBanner.class, "Banner");
+ }
++
++ // CraftBukkit start - add method
++ public InventoryHolder getOwner() {
++ org.bukkit.block.BlockState state = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState();
++ if (state instanceof InventoryHolder) return (InventoryHolder) state;
++ return null;
++ }
++ // CraftBukkit end
+ }