1
0
鏡像自 https://github.com/minetest-mods/unified_inventory.git 已同步 2025-09-18 13:50:35 +02:00

clean itemname before checking existence

此提交包含在:
Niklp09
2023-07-05 21:23:08 +02:00
父節點 2426b6c912
當前提交 a783865267

10
api.lua
查看文件

@@ -12,8 +12,14 @@ 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 = ""
for s in itemname:gmatch("%S+") do
if itemname_cleaned == "" then
itemname_cleaned = s
end
end
if not minetest.registered_items[itemname_cleaned]
or minetest.get_item_group(itemname_cleaned, "not_in_craft_guide") ~= 0 then
return false
end
end