summaryrefslogtreecommitdiff
path: root/internal.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2015-07-30 09:13:16 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2015-07-30 09:13:16 -0400
commitf2914b3d4fc31364d02cab190445f11ffdef5e3a (patch)
treef49c830b8b7f17e3496067c1348aa51c7242c771 /internal.lua
parent56892b8e75afdf808f2546cda29fb6cee17d05b2 (diff)
only show items in crafting guide if they can be crafted or player has creative
Diffstat (limited to 'internal.lua')
-rw-r--r--internal.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal.lua b/internal.lua
index 5dc3795..161280c 100644
--- a/internal.lua
+++ b/internal.lua
@@ -202,7 +202,11 @@ function unified_inventory.apply_filter(player, filter, search_dir)
end
unified_inventory.filtered_items_list[player_name]={}
for name, def in pairs(minetest.registered_items) do
- if (def.groups.not_in_creative_inventory or 0) == 0 and (def.description or "") ~= "" and ffilter(name, def) then
+ if (def.groups.not_in_creative_inventory or 0) == 0
+ and (def.description or "") ~= ""
+ and ffilter(name, def)
+ and (unified_inventory.is_creative(player_name)
+ or unified_inventory.crafts_for.recipe[def.name]) then
table.insert(unified_inventory.filtered_items_list[player_name], name)
end
end