From 6f68fc4ba4aeff5091b6fa9bd5df70c573a2ce53 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Sat, 16 Mar 2013 18:32:01 -0500 Subject: [PATCH] Add missing getOwner method for container minecarts. --- .../java/net/minecraft/server/EntityMinecartContainer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java index e7398f8d3e..b6d324c6bb 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java @@ -5,6 +5,7 @@ import java.util.List; import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; +import org.bukkit.inventory.InventoryHolder; // CraftBukkit end public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements IInventory { @@ -32,6 +33,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp return transaction; } + public InventoryHolder getOwner() { + org.bukkit.entity.Entity cart = getBukkitEntity(); + if(cart instanceof InventoryHolder) return (InventoryHolder) cart; + return null; + } + public void setMaxStackSize(int size) { maxStack = size; }