better way to get itemname

This commit is contained in:
Niklp09 2023-07-06 14:25:38 +02:00
parent a783865267
commit 8b82857fd7
1 changed files with 1 additions and 6 deletions

View File

@ -12,12 +12,7 @@ local function is_recipe_craftable(recipe)
end
else
-- Possibly an item
local itemname_cleaned = ""
for s in itemname:gmatch("%S+") do
if itemname_cleaned == "" then
itemname_cleaned = s
end
end
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