From f41ba498ee9ec258ac6b50ae04ba04f9529bacc5 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 15 Mar 2026 15:11:37 -0400 Subject: [PATCH] Enhance display of inventory groups with detailed device information --- inventoryManager.lua | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/inventoryManager.lua b/inventoryManager.lua index a582eca..258aa76 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -71,5 +71,30 @@ local function displayGroups(itemMap) end end - -- Only show groups where at least one chest AND one dropper share the item - local isGroup = #_ + -- Mark as group when at least one chest AND one dropper share the item + local isGroup = #chests > 0 and #droppers > 0 + local tag = isGroup and "[GROUP]" or "[-----]" + + print(tag .. " " .. itemName) + + for _, device in ipairs(devices) do + local label = device.type == "minecraft:chest" and "CHEST " or "DROPPER" + print(string.format(" %s %-35s x%d", label, device.name, device.count)) + end + + print("") + end +end + +-- Main +local devices = getInventoryDevices() +print("Scanning " .. #devices .. " inventories...") +print("") + +if #devices == 0 then + print("No chests or droppers found on the network.") + return +end + +local itemMap = buildItemMap(devices) +displayGroups(itemMap)