mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
[Bleeding] Implemented Inventory.{get,set}MaxStackSize(). Addresses BUKKIT-1076
- Custom inventories also respect this setting now.
This commit is contained in:
1 parent
66e067f373
commit
5c8fd4995f
14 files changed
+105
-26
No files matched your search
@@ -45,6 +45,11 @@ public class InventoryLargeChest implements IInventory {
|
||||
public InventoryHolder getOwner() {
|
||||
return null; // This method won't be called since CraftInventoryDoubleChest doesn't defer to here
|
||||
}
|
||||
|
||||
public void setMaxStackSize(int size) {
|
||||
this.left.setMaxStackSize(size);
|
||||
this.right.setMaxStackSize(size);
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
public InventoryLargeChest(String s, IInventory iinventory, IInventory iinventory1) {
|
||||
@@ -90,7 +95,7 @@ public class InventoryLargeChest implements IInventory {
|
||||
}
|
||||
|
||||
public int getMaxStackSize() {
|
||||
return this.left.getMaxStackSize();
|
||||
return Math.min(this.left.getMaxStackSize(), this.right.getMaxStackSize()); // CraftBukkit - check both sides
|
||||
}
|
||||
|
||||
public void update() {
|
||||
|
||||
Reference in new issue
Block a user