diff options
author | Pedro Gimeno <pgimeno@email.fake> | 2016-03-31 02:54:22 +0200 |
---|---|---|
committer | Pedro Gimeno <pgimeno@email.fake> | 2016-03-31 03:11:32 +0200 |
commit | f23b4aed658b829773832fdfe57db358e4259148 (patch) | |
tree | deebafcf945ef6816a75ed315cc2032464ddebc5 | |
parent | bdf9b61779b454e687b81e2dc3df7edc8a52e68b (diff) |
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.
-rw-r--r-- | api.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |