From f095e18e9553a37b9553b580fe8b78208f5222ca Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 22 Mar 2026 22:19:08 -0400 Subject: [PATCH] fix: simplify crafting turtle detection logic by removing unnecessary method checks --- inventoryManager.lua | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/inventoryManager.lua b/inventoryManager.lua index 8eb4042..c09a25b 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -224,20 +224,13 @@ local function main() log.warn("INIT", "No modem found for client sync") end - -- Detect crafting turtle on network (must have craft() method) + -- Detect crafting turtle on network + -- The actual craft message goes on CRAFT_CHANNEL which only the crafting + -- turtle listens to, so we just need any turtle name for presence checks. for _, name in ipairs(peripheral.getNames()) do if name:match("^turtle_") then - local methods = peripheral.getMethods(name) - if methods then - local hasCraft = false - for _, m in ipairs(methods) do - if m == "craft" then hasCraft = true; break end - end - if hasCraft then - ctx.craftTurtleName = name - break - end - end + ctx.craftTurtleName = name + break end end if ctx.craftTurtleName then