Skip to content

Commit a5b5662

Browse files
authored
Fix remainder calculation (#49)
1 parent 3babdcf commit a5b5662

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

cannons-bukkit/src/main/java/at/pavlov/cannons/utils/InventoryManagement.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ public static Pair<Integer, Runnable> checkAndPrepareRemoval(List<Inventory> inv
149149
int remainder = amount;
150150
List<Runnable> actions = new ArrayList<>();
151151
for (var inv : inventory) {
152-
int before = remainder;
153152
var result = checkAndPrepareRemoval(inv, valid, remainder);
154-
remainder -= before - result.first();
153+
remainder = result.first();
155154
actions.add(result.second());
156155

157156
if (remainder == 0) {

0 commit comments

Comments
 (0)