--- a/net/minecraft/world/inventory/InventoryEnderChest.java +++ b/net/minecraft/world/inventory/InventoryEnderChest.java @@ -8,13 +8,31 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.TileEntityEnderChest; +// CraftBukkit start +import org.bukkit.Location; +import org.bukkit.inventory.InventoryHolder; +// CraftBukkit end + public class InventoryEnderChest extends InventorySubcontainer { @Nullable private TileEntityEnderChest activeChest; + // CraftBukkit start + private final EntityHuman owner; + + public InventoryHolder getBukkitOwner() { + return owner.getBukkitEntity(); + } + + @Override + public Location getLocation() { + return this.activeChest != null ? new Location(this.activeChest.getWorld().getWorld(), this.activeChest.getPosition().getX(), this.activeChest.getPosition().getY(), this.activeChest.getPosition().getZ()) : null; + } - public InventoryEnderChest() { + public InventoryEnderChest(EntityHuman owner) { super(27); + this.owner = owner; + // CraftBukkit end } public void a(TileEntityEnderChest tileentityenderchest) {