From d0b482571c55c10791d85b71f02d81954ac8c259 Mon Sep 17 00:00:00 2001 From: Niklp Date: Mon, 18 Mar 2024 15:08:31 +0100 Subject: [PATCH] Remove all `not_in_creative_inventory` items from craftguide --- api.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 7ab5d66..6734459 100644 --- a/api.lua +++ b/api.lua @@ -198,11 +198,21 @@ minetest.after(0.01, function() ]] cat_def[itemname] = nil end + if minetest.registered_items[itemname] and minetest.registered_items[itemname].groups.not_in_creative_inventory then + total_removed = total_removed + 1 + --[[ + -- For analysis + minetest.log("warning", "[unified_inventory] Removed item '" + .. itemname .. "' from category '" .. cat_name + .. "'. Reason: item is in 'not_in_creative_inventory' group") + --]] + cat_def[itemname] = nil + end end end if total_removed > 0 then minetest.log("info", "[unified_inventory] Removed " .. total_removed .. - " unknown items from the categories.") + " items from the categories.") end for _, callback in ipairs(ui.initialized_callbacks) do