diff --git a/src/main/java/net/minestom/server/inventory/click/InventoryClickProcessor.java b/src/main/java/net/minestom/server/inventory/click/InventoryClickProcessor.java index 3b969f408..36665b092 100644 --- a/src/main/java/net/minestom/server/inventory/click/InventoryClickProcessor.java +++ b/src/main/java/net/minestom/server/inventory/click/InventoryClickProcessor.java @@ -189,12 +189,8 @@ public class InventoryClickProcessor { return !result.isCancel(); }); - var itemResult = pair.left(); - var map = pair.right(); - map.forEach(targetInventory::setItemStack); - + ItemStack itemResult = TransactionOption.ALL.fill(targetInventory, pair.left(), pair.right()); clickResult.setClicked(itemResult); - return clickResult; } @@ -216,12 +212,8 @@ public class InventoryClickProcessor { return !result.isCancel(); }, start, end, step); - var itemResult = pair.left(); - var map = pair.right(); - map.forEach(targetInventory::setItemStack); - + ItemStack itemResult = TransactionOption.ALL.fill(targetInventory, pair.left(), pair.right()); clickResult.setClicked(itemResult); - return clickResult; }