diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-01-16 16:39:05 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-01-16 16:39:11 +0100 |
commit | d048167d16a404f1f0616d3b62797fce17311198 (patch) | |
tree | 16ff969e7dc3d6e2fc61cebcf59df0b4ef2e50e3 /src/main/java | |
parent | 7ea93a11059f9c36e0cbda207b7c4dc13a67c8ef (diff) | |
download | craftbukkit-d048167d16a404f1f0616d3b62797fce17311198.tar craftbukkit-d048167d16a404f1f0616d3b62797fce17311198.tar.gz craftbukkit-d048167d16a404f1f0616d3b62797fce17311198.tar.lz craftbukkit-d048167d16a404f1f0616d3b62797fce17311198.tar.xz craftbukkit-d048167d16a404f1f0616d3b62797fce17311198.zip |
Fixed removeItem implementation
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index fd24050a..8b7c06b1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -234,18 +234,19 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { if (first == -1) { item.setAmount( toDelete ); leftover.put(i, item); + break; } else { - ItemStack itemStack = getItem(first); + CraftItemStack itemStack = getItem(first); int amount = itemStack.getAmount(); if (amount <= toDelete) { toDelete -= amount; // clear the slot, all used up - clear( i ); + clear( first ); } else { // split the stack and store itemStack.setAmount( amount - toDelete ); - setItem( i, itemStack ); + setItem( first, itemStack ); toDelete = 0; } } |