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