CraftBukkit/nms-patches/net/minecraft/world/inventory/InventoryEnderChest.patch
2021-11-22 09:00:00 +11:00

36 lines
1.2 KiB
Diff

--- 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.getLevel().getWorld(), this.activeChest.getBlockPos().getX(), this.activeChest.getBlockPos().getY(), this.activeChest.getBlockPos().getZ()) : null;
+ }
- public InventoryEnderChest() {
+ public InventoryEnderChest(EntityHuman owner) {
super(27);
+ this.owner = owner;
+ // CraftBukkit end
}
public void setActiveChest(TileEntityEnderChest tileentityenderchest) {