13
0
geforkt von Mirrors/Paper
Paper/paper-server/nms-patches/TileEntity.patch
CraftBukkit/Spigot a419776f3c Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/

By: Thinkofdeath <thinkofdeath@spigotmc.org>
2014-11-26 08:32:16 +11:00

25 Zeilen
940 B
Diff

--- ../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
}