Skip to content

Commit

Permalink
Clean itemname before checking existence (#234)
Browse files Browse the repository at this point in the history
important when the item string contains metadata
  • Loading branch information
Niklp09 committed Jul 11, 2023
1 parent 2426b6c commit 5d233a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d233a0

Please sign in to comment.