--- a/net/minecraft/world/SimpleContainer.java
+++ b/net/minecraft/world/SimpleContainer.java
@@ -15,11 +_,94 @@
 
 public class SimpleContainer implements Container, StackedContentsCompatible {
     private final int size;
-    private final NonNullList<ItemStack> items;
+    public final NonNullList<ItemStack> items;
     @Nullable
     private List<ContainerListener> listeners;
 
+    // Paper start - add fields and methods
+    public List<org.bukkit.entity.HumanEntity> transaction = new java.util.ArrayList<>();
+    private int maxStack = MAX_STACK;
+    protected @Nullable org.bukkit.inventory.InventoryHolder bukkitOwner; // Paper - annotation
+
+    @Override
+    public List<ItemStack> getContents() {
+        return this.items;
+    }
+
+    @Override
+    public void onOpen(org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
+        this.transaction.add(player);
+    }
+
+    @Override
+    public void onClose(org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
+        this.transaction.remove(player);
+    }
+
+    @Override
+    public List<org.bukkit.entity.HumanEntity> getViewers() {
+        return this.transaction;
+    }
+
+    @Override
+    public int getMaxStackSize() {
+        return this.maxStack;
+    }
+
+    @Override
+    public void setMaxStackSize(int size) {
+        this.maxStack = size;
+    }
+
+    @Override
+    public @Nullable org.bukkit.inventory.InventoryHolder getOwner() {
+        // Paper start - Add missing InventoryHolders
+        if (this.bukkitOwner == null && this.bukkitOwnerCreator != null) {
+            this.bukkitOwner = this.bukkitOwnerCreator.get();
+        }
+        // Paper end - Add missing InventoryHolders
+        return this.bukkitOwner;
+    }
+
+    @Override
+    public @Nullable org.bukkit.Location getLocation() {
+        // Paper start - Fix inventories returning null Locations
+        // When the block inventory does not have a tile state that implements getLocation, e. g. composters
+        if (this.bukkitOwner instanceof org.bukkit.inventory.BlockInventoryHolder blockInventoryHolder) {
+            return blockInventoryHolder.getBlock().getLocation();
+        }
+        // When the bukkit owner is a bukkit entity, but does not implement Container itself, e. g. horses
+        if (this.bukkitOwner instanceof org.bukkit.entity.Entity entity) {
+            return entity.getLocation();
+        }
+        // Paper end - Fix inventories returning null Locations
+        return null;
+    }
+
+    public SimpleContainer(SimpleContainer original) {
+        this(original.size);
+        for (int slot = 0; slot < original.size; slot++) {
+            this.items.set(slot, original.items.get(slot).copy());
+        }
+    }
+    // Paper end
+
     public SimpleContainer(int size) {
+        this(size, null);
+    }
+
+    // Paper start - Add missing InventoryHolders
+    private @Nullable java.util.function.Supplier<? extends org.bukkit.inventory.InventoryHolder> bukkitOwnerCreator;
+
+    public SimpleContainer(java.util.function.Supplier<? extends org.bukkit.inventory.InventoryHolder> bukkitOwnerCreator, int size) {
+        this(size);
+        this.bukkitOwnerCreator = bukkitOwnerCreator;
+    }
+    // Paper end - Add missing InventoryHolders
+
+    public SimpleContainer(int size, @Nullable org.bukkit.inventory.InventoryHolder owner) {
+        this.bukkitOwner = owner;
+        // Paper end
         this.size = size;
         this.items = NonNullList.withSize(size, ItemStack.EMPTY);
     }
