mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +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) {
|
public static boolean handleItemPickup(PlayerInventory inventory, Item drop) {
|
||||||
ItemStack dropStack = drop.getItemStack();
|
ItemStack dropStack = drop.getItemStack();
|
||||||
int firstEmpty = inventory.firstEmpty();
|
int firstEmpty = inventory.firstEmpty();
|
||||||
|
int dropAmount = dropStack.getAmount();
|
||||||
|
|
||||||
if (inventory.containsAtLeast(dropStack, 1)) {
|
if (inventory.containsAtLeast(dropStack, 1)) {
|
||||||
int dropAmount = dropStack.getAmount();
|
|
||||||
int nextSlot = 0;
|
int nextSlot = 0;
|
||||||
|
|
||||||
for (Iterator<ItemStack> iterator = inventory.iterator(); iterator.hasNext();) {
|
for (Iterator<ItemStack> iterator = inventory.iterator(); iterator.hasNext();) {
|
||||||
@ -72,6 +72,7 @@ public class Unarmed {
|
|||||||
|
|
||||||
if (itemstack == null) {
|
if (itemstack == null) {
|
||||||
drop.remove();
|
drop.remove();
|
||||||
|
dropStack.setAmount(dropAmount);
|
||||||
inventory.setItem(nextSlot, dropStack);
|
inventory.setItem(nextSlot, dropStack);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -80,6 +81,8 @@ public class Unarmed {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dropStack.setAmount(dropAmount); // Even when only partially finished we need to prevent dupes
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user