Fix drag click

This commit is contained in:
TheMode 2021-04-12 16:27:12 +02:00
parent 0fea9b39a2
commit 2531161964

View File

@ -289,12 +289,12 @@ public class InventoryClickProcessor {
final int maxSize = stackingRule.getMaxSize(); final int maxSize = stackingRule.getMaxSize();
if (stackingRule.canBeStacked(cursor, slotItem)) { if (stackingRule.canBeStacked(cursor, slotItem)) {
final int amount = slotItemRule.getAmount(slotItem) + slotSize; final int amount = slotItemRule.getAmount(slotItem);
if (stackingRule.canApply(slotItem, amount)) { if (stackingRule.canApply(slotItem, amount + slotSize)) {
slotItem = stackingRule.apply(slotItem, amount); slotItem = stackingRule.apply(slotItem, a -> a + slotSize);
finalCursorAmount -= slotSize; finalCursorAmount -= slotSize;
} else { } else {
final int removedAmount = amount - maxSize; final int removedAmount = maxSize - amount;
slotItem = stackingRule.apply(slotItem, maxSize); slotItem = stackingRule.apply(slotItem, maxSize);
finalCursorAmount -= removedAmount; finalCursorAmount -= removedAmount;
} }