Essentially I want to turn
Code: Select all
recipe = {
{"", "", "" },
{"group:wood", "", "group:wood"},
{"group:wood", "group:wood", "group:wood"},
},
Code: Select all
recipe = {{"group:wood 5"}},
Here's what I've written so far:
Spoiler
Code: Select all
function values(t)
local i = 0
return function() i = i + 1; return t[i] end
end
local items = minetest.registered_items
for _,a in pairs(items) do
local recipe = minetest.get_all_craft_recipes(a.name)
if a.tiles ~= nil and recipe ~= nil then
for b in values(recipe) do
for c in values(b.items) do
--CODE??
end
crafting.register_recipe({
type = "inv",
output = b.output,
items = b.items,
always_known = true,
})
end
end
end