Properly update diff in NaturalSpawner

This commit is contained in:
Nassim Jahnke
2024-12-19 11:30:22 +01:00
parent 8f5d9953f5
commit 0eb8f95dec
3 changed files with 29 additions and 39 deletions

View File

@@ -4,7 +4,7 @@
public final Container container1;
public final Container container2;
+ // Paper start - add fields and methods
+ // CraftBukkit start - add fields and methods
+ public java.util.List<org.bukkit.entity.HumanEntity> transaction = new java.util.ArrayList<>();
+
+ public java.util.List<ItemStack> getContents() {
@@ -44,7 +44,7 @@
+ public org.bukkit.Location getLocation() {
+ return this.container1.getLocation(); // TODO: right?
+ }
+ // Paper end
+ // CraftBukkit end
+
public CompoundContainer(Container container1, Container container2) {
this.container1 = container1;
@@ -54,7 +54,7 @@
@Override
public int getMaxStackSize() {
- return this.container1.getMaxStackSize();
+ return Math.min(this.container1.getMaxStackSize(), this.container2.getMaxStackSize()); // Paper - check both sides
+ return Math.min(this.container1.getMaxStackSize(), this.container2.getMaxStackSize()); // CraftBukkit - check both sides
}
@Override