Only display/register visible recipes
Respect the group not_in_craftguide.
This commit is contained in:
parent
8080f772b1
commit
1ed5d7db4f
8
init.lua
8
init.lua
|
@ -499,11 +499,16 @@ end
|
|||
function visible_items(data)
|
||||
local ret = {}
|
||||
for item,_ in pairs(data.held_items) do
|
||||
if _ and item ~= "" then
|
||||
table.insert(ret, item)
|
||||
end
|
||||
end
|
||||
for item,_ in pairs(data.known_items) do
|
||||
if _ and item ~= "" then
|
||||
table.insert(ret, item)
|
||||
end
|
||||
end
|
||||
table.sort(ret)
|
||||
return ret
|
||||
end
|
||||
|
||||
|
@ -529,9 +534,12 @@ function update_known_items(player, item_name)
|
|||
-- Mark items craftable with this (and other) items as known.
|
||||
local new_recipes = 0
|
||||
for _,out_item_name in pairs(known_crafting_outputs(data, item_name)) do
|
||||
data.known_items[out_item_name] = true
|
||||
if show_item(minetest.registered_items[out_item_name]) then
|
||||
new_recipes = new_recipes + 1
|
||||
data.known_items[out_item_name] = true
|
||||
end
|
||||
end
|
||||
|
||||
-- Reset item-list.
|
||||
data.items = visible_items(data)
|
||||
|
|
Ŝarĝante…
Reference in New Issue