[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.
This commit is contained in:
GJ 2014-01-23 10:15:53 -08:00 committed by Travis Watkins
parent a4fe7cd3c4
commit 0a179711aa
4 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -145,7 +145,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
}
public int getMaxStackSize() {
return 64;
return maxStack; // CraftBukkit
}
public void b(int i) {

View File

@ -411,7 +411,7 @@ public class PlayerInventory implements IInventory {
}
public int getMaxStackSize() {
return 64;
return maxStack; // CraftBukkit
}
public boolean b(Block block) {

View File

@ -150,7 +150,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
}
public int getMaxStackSize() {
return 64;
return maxStack; // CraftBukkit
}
public boolean a(EntityHuman entityhuman) {