diff --git a/cooking.lua b/cooking.lua index 881fa25..fc895fc 100644 --- a/cooking.lua +++ b/cooking.lua @@ -106,7 +106,7 @@ minetest.register_abm({ if obj and obj:get_luaentity() then local itemstring = obj:get_luaentity().itemstring:match("([%w_:]+)%s") for _, ing in pairs(ingredients_list) do - if itemstring and ing == itemstring:match(ing) + if itemstring and itemstring:match(ing) and not minetest.serialize(ingredients):find(itemstring) then ingredients[#ingredients+1] = itemstring end diff --git a/enchanting.lua b/enchanting.lua index 83dbc33..06ef1fe 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -80,10 +80,11 @@ end local function allowed(tool) for item, _ in pairs(minetest.registered_tools) do - for t in item:gmatch("enchanted_"..tool) do - if t then return true end - end + if item:match("enchanted_"..tool) then + return true + end end + return false end