From c60f4436f0525cb18671de65a4e9163f20244425 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Mon, 4 Aug 2025 13:53:50 +0200 Subject: [PATCH] Restore players being the inventory holder of an enderchest (#12923) --- .../PlayerEnderChestContainer.java.patch | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/inventory/PlayerEnderChestContainer.java.patch b/paper-server/patches/sources/net/minecraft/world/inventory/PlayerEnderChestContainer.java.patch index c30aff9c1..7c26930d5 100644 --- a/paper-server/patches/sources/net/minecraft/world/inventory/PlayerEnderChestContainer.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/inventory/PlayerEnderChestContainer.java.patch @@ -1,27 +1,20 @@ --- a/net/minecraft/world/inventory/PlayerEnderChestContainer.java +++ b/net/minecraft/world/inventory/PlayerEnderChestContainer.java -@@ -12,9 +_,22 @@ - public class PlayerEnderChestContainer extends SimpleContainer { +@@ -13,8 +_,15 @@ @Nullable private EnderChestBlockEntity activeChest; -- + - public PlayerEnderChestContainer() { -+ // CraftBukkit start -+ private final Player owner; -+ -+ public org.bukkit.inventory.InventoryHolder getBukkitOwner() { -+ return this.owner.getBukkitEntity(); -+ } -+ +- super(27); ++ // Paper start + @Override + public @Nullable org.bukkit.Location getLocation() { + return this.activeChest != null ? org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.activeChest.getBlockPos(), this.activeChest.getLevel().getWorld()) : null; + } + + public PlayerEnderChestContainer(Player owner) { - super(27); -+ this.owner = owner; -+ // CraftBukkit end ++ super(27, owner.getBukkitEntity()); ++ // Paper end } public void setActiveChest(EnderChestBlockEntity enderChestBlockEntity) {