forked from minetest-mods/unified_inventory
Clean itemname before checking existence (#234)
important when the item string contains metadata
This commit is contained in:
parent
2426b6c912
commit
5d233a0f0a
5
api.lua
5
api.lua
@ -12,8 +12,9 @@ local function is_recipe_craftable(recipe)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Possibly an item
|
-- Possibly an item
|
||||||
if not minetest.registered_items[itemname]
|
local itemname_cleaned = ItemStack(itemname):get_name()
|
||||||
or minetest.get_item_group(itemname, "not_in_craft_guide") ~= 0 then
|
if not minetest.registered_items[itemname_cleaned]
|
||||||
|
or minetest.get_item_group(itemname_cleaned, "not_in_craft_guide") ~= 0 then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user