From 14da1a3dd0e9f93703cf668c7095e2e8974d668d Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Fri, 22 Apr 2022 22:01:15 +0200 Subject: [PATCH] Fix reverse item lookup ("usage") broken by 5ac2558 > return { specname } This returned a number-indexed table whereas the code expects a name-indexed table --- api.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 64efe0b..1609217 100644 --- a/api.lua +++ b/api.lua @@ -151,7 +151,7 @@ minetest.after(0.01, function() -- Step 2: Find all matching items for the given spec (groups) local function get_matching_spec_items(specname) if specname:sub(1,6) ~= "group:" then - return { specname } + return { [specname] = true } end local accepted = {} @@ -177,6 +177,7 @@ minetest.after(0.01, function() end for _, recipes in pairs(ui.crafts_for.recipe) do + -- List of crafts that return this item string (variable "_") for _, recipe in ipairs(recipes) do local ingredient_items = {} for _, spec in pairs(recipe.items) do