Fix stack merge count bug
This commit is contained in:
parent
767f698201
commit
22a1da1b8d
@ -196,17 +196,11 @@ public class SortCommandExecutor implements CommandExecutor {
|
|||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
stacks[i] = new ItemStack(Material.AIR);
|
stacks[i] = new ItemStack(Material.AIR);
|
||||||
} else {
|
} else {
|
||||||
final int currentAmount = current.getAmount();
|
final int newAmount = Math.min(amount, current.getMaxStackSize());
|
||||||
|
current.setAmount(newAmount);
|
||||||
|
|
||||||
if (currentAmount < current.getMaxStackSize()) {
|
// Update remaining count of given material
|
||||||
final int newAmount = Math.min(amount, current.getMaxStackSize());
|
count.put(key, amount - newAmount);
|
||||||
current.setAmount(newAmount);
|
|
||||||
|
|
||||||
// Update remaining count of given material
|
|
||||||
count.put(key, amount - newAmount);
|
|
||||||
} else {
|
|
||||||
count.put(key, amount - currentAmount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warning("Found untracked ItemStack while merging stacks");
|
logger.warning("Found untracked ItemStack while merging stacks");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user