From 7618be3d2da7dfccade8aad197c39d9584812b97 Mon Sep 17 00:00:00 2001 From: JosTheDude Date: Tue, 26 May 2026 22:38:04 -0400 Subject: [PATCH 1/2] feat: inventory full duplicate message fix --- build.gradle | 2 +- .../sellgui/command/CommandSellGUI.java | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 08f92e1..f445c4a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group 'net.mackenziemolloy.shopguiplus.sellgui' -version '1.1.8' +version '1.1.9' java { toolchain { diff --git a/src/main/java/net/mackenziemolloy/shopguiplus/sellgui/command/CommandSellGUI.java b/src/main/java/net/mackenziemolloy/shopguiplus/sellgui/command/CommandSellGUI.java index 78da7f3..4d2a82f 100644 --- a/src/main/java/net/mackenziemolloy/shopguiplus/sellgui/command/CommandSellGUI.java +++ b/src/main/java/net/mackenziemolloy/shopguiplus/sellgui/command/CommandSellGUI.java @@ -362,7 +362,7 @@ private void onGuiClose(Player player, InventoryCloseEvent event, Set i double totalPrice = 0; int itemAmount = 0; - boolean excessItems = false; + List droppedItems = new ArrayList<>(); boolean itemsPlacedInGui = false; Inventory inventory = event.getInventory(); @@ -408,19 +408,17 @@ private void onGuiClose(Player player, InventoryCloseEvent event, Set i double amountSold2 = (totalSold2 + itemSellPrice); moneyMap.put(itemEconomyType, amountSold2); } else { - excessItems = true; - - Location location = player.getLocation().add(0.0D, 0.5D, 0.0D); Map fallenItems = event.getPlayer().getInventory().addItem(i); - scheduler.runAtLocation(location, task -> { - World world = player.getWorld(); - fallenItems.values().forEach(item -> world.dropItemNaturally(location, item)); - }); + droppedItems.addAll(fallenItems.values()); } } - if (excessItems) { + if (!droppedItems.isEmpty()) { sendMessage(player, "inventory_full"); + Location location = player.getLocation().add(0.0D, 0.5D, 0.0D); + World world = location.getWorld(); + scheduler.runAtLocation(location, task -> + droppedItems.forEach(item -> world.dropItemNaturally(location, item))); } if (totalPrice == 0) { From 570b518bef0414890acc50eb88561a821f748240 Mon Sep 17 00:00:00 2001 From: JosTheDude <43651265+JosTheDude@users.noreply.github.com> Date: Wed, 27 May 2026 08:36:58 -0400 Subject: [PATCH 2/2] chore: remove plugin version bump (req: maintainers) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f445c4a..08f92e1 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group 'net.mackenziemolloy.shopguiplus.sellgui' -version '1.1.9' +version '1.1.8' java { toolchain {