[Bleeding] Implemented Inventory.{get,set}MaxStackSize(). Addresses BUKKIT-1076

- Custom inventories also respect this setting now.
This commit is contained in:
Celtic Minstrel authored and EvilSeph committed 2012-03-15 22:44:10 -04:00
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() {