diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/InventoryCrafting.java')
-rw-r--r-- | src/main/java/net/minecraft/server/InventoryCrafting.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java index ade98090..857ad0e7 100644 --- a/src/main/java/net/minecraft/server/InventoryCrafting.java +++ b/src/main/java/net/minecraft/server/InventoryCrafting.java @@ -20,7 +20,9 @@ public class InventoryCrafting implements IInventory { public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); public CraftingRecipe currentRecipe; public IInventory resultInventory; - + private EntityHuman owner; + private int maxStack = MAX_STACK; + public ItemStack[] getContents() { return this.items; } @@ -28,7 +30,7 @@ public class InventoryCrafting implements IInventory { public void onOpen(CraftHumanEntity who) { transaction.add(who); } - + public InventoryType getInvType() { return items.length == 4 ? InventoryType.CRAFTING : InventoryType.WORKBENCH; } @@ -36,13 +38,23 @@ public class InventoryCrafting implements IInventory { public void onClose(CraftHumanEntity who) { transaction.remove(who); } - + public List<HumanEntity> getViewers() { return transaction; } - + public InventoryHolder getOwner() { - return null; // TODO: Crafting grids don't really have an owner? Maybe they should? + return owner.getBukkitEntity(); + } + + public void setMaxStackSize(int size) { + maxStack = size; + resultInventory.setMaxStackSize(size); + } + + public InventoryCrafting(Container container, int i, int j, EntityHuman player) { + this(container, i, j); + this.owner = player; } // CraftBukkit end @@ -116,7 +128,7 @@ public class InventoryCrafting implements IInventory { } public int getMaxStackSize() { - return 64; + return maxStack; // CraftBukkit } public void update() {} |