diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-30 02:51:26 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-30 02:51:26 -0500 |
commit | a1c38cd8f331709157d1923e0a133b28b9b0585f (patch) | |
tree | 536e0657f8653c4663f6be6ed6d9690b08a657e3 /src/main | |
parent | af7ea28bc76581243308997ad2df9b020cf1853d (diff) | |
download | craftbukkit-a1c38cd8f331709157d1923e0a133b28b9b0585f.tar craftbukkit-a1c38cd8f331709157d1923e0a133b28b9b0585f.tar.gz craftbukkit-a1c38cd8f331709157d1923e0a133b28b9b0585f.tar.lz craftbukkit-a1c38cd8f331709157d1923e0a133b28b9b0585f.tar.xz craftbukkit-a1c38cd8f331709157d1923e0a133b28b9b0585f.zip |
Include anvil result in inventory size. Fixes BUKKIT-3741
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/ContainerAnvil.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java index 21cf6275..9aaa8f96 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -376,7 +376,7 @@ public class ContainerAnvil extends Container { return bukkitEntity; } - org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryAnvil(this.g); + org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryAnvil(this.g, this.f); bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this); return bukkitEntity; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java index 57f54be9..a91d81ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java @@ -4,7 +4,23 @@ import net.minecraft.server.IInventory; import org.bukkit.inventory.AnvilInventory; public class CraftInventoryAnvil extends CraftInventory implements AnvilInventory { - public CraftInventoryAnvil(IInventory anvil) { - super(anvil); + private final IInventory resultInventory; + + public CraftInventoryAnvil(IInventory inventory, IInventory resultInventory) { + super(inventory); + this.resultInventory = resultInventory; + } + + public IInventory getResultInventory() { + return resultInventory; + } + + public IInventory getIngredientsInventory() { + return inventory; + } + + @Override + public int getSize() { + return getResultInventory().getSize() + getIngredientsInventory().getSize(); } } |