diff options
author | Celtic Minstrel <celtic.minstrel.ca@some.place> | 2012-03-14 10:00:54 -0400 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-15 22:44:10 -0400 |
commit | 5c8fd4995f2bd4817e4a822ab63a485e4abc1ab2 (patch) | |
tree | f0da8ed8ed6f0474d0863719a858692105e0fb91 /src/main/java/net/minecraft/server/InventoryLargeChest.java | |
parent | 66e067f37335ddb6261487744c42e4efc709d2b9 (diff) | |
download | craftbukkit-5c8fd4995f2bd4817e4a822ab63a485e4abc1ab2.tar craftbukkit-5c8fd4995f2bd4817e4a822ab63a485e4abc1ab2.tar.gz craftbukkit-5c8fd4995f2bd4817e4a822ab63a485e4abc1ab2.tar.lz craftbukkit-5c8fd4995f2bd4817e4a822ab63a485e4abc1ab2.tar.xz craftbukkit-5c8fd4995f2bd4817e4a822ab63a485e4abc1ab2.zip |
[Bleeding] Implemented Inventory.{get,set}MaxStackSize(). Addresses BUKKIT-1076
- Custom inventories also respect this setting now.
Diffstat (limited to 'src/main/java/net/minecraft/server/InventoryLargeChest.java')
-rw-r--r-- | src/main/java/net/minecraft/server/InventoryLargeChest.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/InventoryLargeChest.java b/src/main/java/net/minecraft/server/InventoryLargeChest.java index 159740c6..0f23a2f8 100644 --- a/src/main/java/net/minecraft/server/InventoryLargeChest.java +++ b/src/main/java/net/minecraft/server/InventoryLargeChest.java @@ -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() { |