diff options
Diffstat (limited to 'src/main/java/org/bukkit')
-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; } } |