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

- Custom inventories also respect this setting now.
This commit is contained in:
Celtic Minstrel
2012-03-14 10:00:54 -04:00
committed by EvilSeph
parent 66e067f373
commit 5c8fd4995f
14 changed files with 105 additions and 26 deletions

View File

@@ -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() {