From f23b4aed658b829773832fdfe57db358e4259148 Mon Sep 17 00:00:00 2001 From: Pedro Gimeno Date: Thu, 31 Mar 2016 02:54:22 +0200 Subject: [PATCH] Allow items to exclude their recipes from the recipes list Certain mods add many recipes that take smaller blocks and output a bigger block. This clutters the recipes list. Case in point: the circular saw from the moreblocks mod. This patch allows mods to tell the craft guide to not include recipes that contain certain items, by setting the group exclude_from_craft_guide = 1 in the items. --- api.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 59296db..872ce32 100644 --- a/api.lua +++ b/api.lua @@ -25,7 +25,8 @@ minetest.after(0.01, function() for _,chk in pairs(recipe.items) do local groupchk = string.find(chk, "group:") if (not groupchk and not minetest.registered_items[chk]) - or (groupchk and not unified_inventory.get_group_item(string.gsub(chk, "group:", "")).item) then + or (groupchk and not unified_inventory.get_group_item(string.gsub(chk, "group:", "")).item) + or minetest.get_item_group(chk, "exclude_from_craft_guide") ~= 0 then unknowns = true end end