mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-28 03:27:39 +01:00
Fix Dupe bug...... why was this overlooked?
This commit is contained in:
parent
d5dc9895e4
commit
4ea3d690db
@ -29,9 +29,9 @@ public class Unarmed {
|
||||
public static boolean handleItemPickup(PlayerInventory inventory, Item drop) {
|
||||
ItemStack dropStack = drop.getItemStack();
|
||||
int firstEmpty = inventory.firstEmpty();
|
||||
int dropAmount = dropStack.getAmount();
|
||||
|
||||
if (inventory.containsAtLeast(dropStack, 1)) {
|
||||
int dropAmount = dropStack.getAmount();
|
||||
int nextSlot = 0;
|
||||
|
||||
for (Iterator<ItemStack> iterator = inventory.iterator(); iterator.hasNext();) {
|
||||
@ -72,6 +72,7 @@ public class Unarmed {
|
||||
|
||||
if (itemstack == null) {
|
||||
drop.remove();
|
||||
dropStack.setAmount(dropAmount);
|
||||
inventory.setItem(nextSlot, dropStack);
|
||||
return true;
|
||||
}
|
||||
@ -80,6 +81,8 @@ public class Unarmed {
|
||||
}
|
||||
}
|
||||
|
||||
dropStack.setAmount(dropAmount); // Even when only partially finished we need to prevent dupes
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user