Refactor wooden plank crafting

This patch makes it possible to craft planks out of stripped wood.
This commit is contained in:
NO11 2021-06-15 16:39:54 +00:00 committed by Nils Dagsson Moskopp
parent 616b009452
commit eadb96dd40
Signed by untrusted user who does not match committer: erlehmann
GPG Key ID: A3BC671C35191080
1 changed files with 22 additions and 39 deletions

View File

@ -4,47 +4,30 @@
-- Crafting definition -- Crafting definition
-- --
minetest.register_craft({ local function craft_planks(output, input)
output = 'mcl_core:wood 4', minetest.register_craft({
recipe = { output = "mcl_core:"..output.."wood 4",
{'mcl_core:tree'}, recipe = {
} {"mcl_core:"..input},
}) }
})
end
minetest.register_craft({ local planks = {
output = 'mcl_core:darkwood 4', {"", "oak"},
recipe = { {"dark", "dark_oak"},
{'mcl_core:darktree'}, {"jungle", "jungle"},
} {"acacia", "acacia"},
}) {"spruce", "spruce"},
{"birch", "birch"}
}
minetest.register_craft({ for _, p in pairs(planks) do
output = 'mcl_core:junglewood 4', craft_planks(p[1], p[1].."tree")
recipe = { craft_planks(p[1], p[1].."tree_bark")
{'mcl_core:jungletree'}, craft_planks(p[1], "stripped_"..p[2])
} craft_planks(p[1], "stripped_"..p[2].."_bark")
}) end
minetest.register_craft({
output = 'mcl_core:acaciawood 4',
recipe = {
{'mcl_core:acaciatree'},
}
})
minetest.register_craft({
output = 'mcl_core:sprucewood 4',
recipe = {
{'mcl_core:sprucetree'},
}
})
minetest.register_craft({
output = 'mcl_core:birchwood 4',
recipe = {
{'mcl_core:birchtree'},
}
})
minetest.register_craft({ minetest.register_craft({
type = 'shapeless', type = 'shapeless',