summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2013-03-30 02:51:26 -0500
committerTravis Watkins <amaranth@ubuntu.com>2013-03-30 02:51:26 -0500
commita1c38cd8f331709157d1923e0a133b28b9b0585f (patch)
tree536e0657f8653c4663f6be6ed6d9690b08a657e3 /src/main/java/org
parentaf7ea28bc76581243308997ad2df9b020cf1853d (diff)
downloadcraftbukkit-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/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java20
1 files changed, 18 insertions, 2 deletions
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();
}
}