summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Gimeno <pgimeno@email.fake>2016-03-31 02:54:22 +0200
committerPedro Gimeno <pgimeno@email.fake>2016-03-31 03:11:32 +0200
commitf23b4aed658b829773832fdfe57db358e4259148 (patch)
treedeebafcf945ef6816a75ed315cc2032464ddebc5
parentbdf9b61779b454e687b81e2dc3df7edc8a52e68b (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.lua3
1 files changed, 2 insertions, 1 deletions
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