Clean itemname before checking existence (#234)

important when the item string contains metadata
This commit is contained in:
Niklp 2023-07-11 18:12:35 +02:00 committed by GitHub
parent 2426b6c912
commit 5d233a0f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,8 +12,9 @@ local function is_recipe_craftable(recipe)
end
else
-- Possibly an item
if not minetest.registered_items[itemname]
or minetest.get_item_group(itemname, "not_in_craft_guide") ~= 0 then
local itemname_cleaned = ItemStack(itemname):get_name()
if not minetest.registered_items[itemname_cleaned]
or minetest.get_item_group(itemname_cleaned, "not_in_craft_guide") ~= 0 then
return false
end
end