From fce7a2f991e441dc9567a0f582b902dc30d02a70 Mon Sep 17 00:00:00 2001 From: RootBeer Date: Sun, 19 Jul 2026 11:52:02 -0400 Subject: [PATCH] Fix search commands reporting only the first matching player - Resolves https://github.com/Jikoo/OpenInv/issues/413 - Regression introduced by: https://github.com/Jikoo/OpenInv/pull/311 Before the regression, `SearchInvCommand` used two nested loops: an outer loop over online players and an inner loop over the inventory contents. The `break` lived in the **inner** loop, ending the per-item count-up once the requested threshold was reached. That commit extracted the inner loop into `SearchHelper.findMatch(...)` but left the `break` behind. It now sits directly inside the **outer** `for (Player player : ...)` loop, so the entire player scan terminates at the first match. I could be wrong about the intentionality of this `break` statement; however, in my eyes, this looks correct! --- .../main/java/com/lishid/openinv/command/SearchInvCommand.java | 1 - 1 file changed, 1 deletion(-) diff --git a/plugin/src/main/java/com/lishid/openinv/command/SearchInvCommand.java b/plugin/src/main/java/com/lishid/openinv/command/SearchInvCommand.java index c2a5a32d..3264d923 100644 --- a/plugin/src/main/java/com/lishid/openinv/command/SearchInvCommand.java +++ b/plugin/src/main/java/com/lishid/openinv/command/SearchInvCommand.java @@ -85,7 +85,6 @@ public boolean onCommand( Inventory inventory = searchInv ? player.getInventory() : player.getEnderChest(); if (findMatch(inventory, material, count)) { players.append(player.getName()).append(", "); - break; } }