recipe bugfix
This commit is contained in:
parent
806248eb71
commit
a2e5a6e59d
@ -42,6 +42,16 @@ if minetest.global_exists("wielded_light") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function node_group(group)
|
||||||
|
local tbl = {}
|
||||||
|
for key,_ in pairs(minetest.registered_items) do
|
||||||
|
if minetest.get_item_group(key, group) > 0 then
|
||||||
|
tbl[#tbl + 1] = key
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return tbl
|
||||||
|
end
|
||||||
|
|
||||||
minetest.after(1, function()
|
minetest.after(1, function()
|
||||||
for key,_ in pairs(minetest.registered_items) do
|
for key,_ in pairs(minetest.registered_items) do
|
||||||
if key ~= "" then
|
if key ~= "" then
|
||||||
@ -49,11 +59,21 @@ minetest.after(1, function()
|
|||||||
if tbl then
|
if tbl then
|
||||||
for _,recipe in ipairs(tbl) do
|
for _,recipe in ipairs(tbl) do
|
||||||
if recipe and recipe.method == "cooking" then
|
if recipe and recipe.method == "cooking" then
|
||||||
techage.furnace.register_recipe({
|
if recipe.items[1] and string.split(recipe.items[1], ":")[1] == "group" then
|
||||||
output = recipe.output,
|
for _,item in ipairs(node_group(string.split(recipe.items[1], ":")[2])) do
|
||||||
recipe = recipe.items,
|
techage.furnace.register_recipe({
|
||||||
time = math.floor((recipe.width + 1) / 2),
|
output = recipe.output,
|
||||||
})
|
recipe = {item},
|
||||||
|
time = math.floor((recipe.width + 1) / 2),
|
||||||
|
})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
techage.furnace.register_recipe({
|
||||||
|
output = recipe.output,
|
||||||
|
recipe = recipe.items,
|
||||||
|
time = math.floor((recipe.width + 1) / 2),
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user