From 0a179711aaadabd5974ad23401e0c07210b87cc6 Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 23 Jan 2014 10:15:53 -0800 Subject: [PATCH] [Bleeding] Fix some inventories not using maxStack. Fixes BUKKIT-2883 CraftBukkit adds the ability to specify the maxStack size for most inventories. However, some inventories were not overriding the getMaxStack method properly, and so the functionality was unavailable. This fixes the maxStack setting for Anvils, Minecarts, PlayerInventory, and Hoppers. --- .../java/net/minecraft/server/ContainerAnvilInventory.java | 6 ++++++ .../java/net/minecraft/server/EntityMinecartContainer.java | 2 +- src/main/java/net/minecraft/server/PlayerInventory.java | 2 +- src/main/java/net/minecraft/server/TileEntityHopper.java | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/ContainerAnvilInventory.java b/src/main/java/net/minecraft/server/ContainerAnvilInventory.java index 20d7c69cff..1afa6e7929 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvilInventory.java +++ b/src/main/java/net/minecraft/server/ContainerAnvilInventory.java @@ -46,6 +46,12 @@ public class ContainerAnvilInventory extends InventorySubcontainer { // CraftBuk this.setMaxStackSize(1); // CraftBukkit } + // CraftBukkit start - override inherited maxStack from InventorySubcontainer + public int getMaxStackSize() { + return maxStack; + } + // CraftBukkit end + public void update() { super.update(); this.a.a((IInventory) this); diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java index 9f3f196b5c..b599eeba11 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java @@ -145,7 +145,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp } public int getMaxStackSize() { - return 64; + return maxStack; // CraftBukkit } public void b(int i) { diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java index 83cbb97c04..e9b49d1ebe 100644 --- a/src/main/java/net/minecraft/server/PlayerInventory.java +++ b/src/main/java/net/minecraft/server/PlayerInventory.java @@ -411,7 +411,7 @@ public class PlayerInventory implements IInventory { } public int getMaxStackSize() { - return 64; + return maxStack; // CraftBukkit } public boolean b(Block block) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java index 3f1a910ed8..48a882acf9 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -150,7 +150,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { } public int getMaxStackSize() { - return 64; + return maxStack; // CraftBukkit } public boolean a(EntityHuman entityhuman) {