123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444 |
- --[[
- More Blocks: Stairs+
- Copyright © 2011-2020 Hugo Locurcio and contributors.
- Licensed under the zlib license. See LICENSE.md for more information.
- --]]
- stairsplus.register_recipes = function(category, alternate, modname, subname, recipeitem)
- if category == "micro" and alternate == "" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 7",
- recipe = {modname .. ":stair_" .. subname .. "_inner"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 6",
- recipe = {modname .. ":stair_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 5",
- recipe = {modname .. ":stair_" .. subname .. "_outer"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 4",
- recipe = {modname .. ":slab_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 4",
- recipe = {modname .. ":stair_" .. subname .. "_alt"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 3",
- recipe = {modname .. ":stair_" .. subname .. "_right_half"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":micro_" .. subname .. " 2",
- recipe = {modname .. ":panel_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- minetest.register_alias(modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname)
- elseif category == "panel" and alternate == "" then
- minetest.register_craft({
- output = modname .. ":panel_" .. subname .. " 12",
- recipe = {
- {recipeitem, ""},
- {recipeitem, recipeitem},
- },
- })
- minetest.register_craft({
- output = modname .. ":panel_" .. subname .. " 12",
- recipe = {
- {"", recipeitem},
- {recipeitem, recipeitem},
- },
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":panel_" .. subname,
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
- })
- minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
- elseif category == "slab" then
- if alternate == "" then
- minetest.register_craft({
- output = modname .. ":slab_" .. subname .. " 6",
- recipe = {{recipeitem, recipeitem, recipeitem}},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- -- uncomment this rule when conflict is no longer likely to happen
- -- https://github.com/minetest/minetest/issues/2881
- -- minetest.register_craft({
- -- type = "shapeless",
- -- output = modname .. ":slab_" .. subname,
- -- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
- -- })
- -- then remove these two
- minetest.register_craft({
- output = modname .. ":slab_" .. subname,
- recipe = {{modname .. ":panel_" .. subname, modname .. ":panel_" .. subname}},
- })
- minetest.register_craft({
- output = modname .. ":slab_" .. subname,
- recipe = {
- {modname .. ":panel_" .. subname},
- {modname .. ":panel_" .. subname},
- },
- })
- ------------------------------
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. " 3",
- recipe = {modname .. ":stair_" .. subname, modname .. ":stair_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname,
- recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half"},
- })
- elseif alternate == "_quarter" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_quarter"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_quarter",
- recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_quarter",
- recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"},
- })
- elseif alternate == "_three_quarter" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_three_quarter",
- recipe = {modname .. ":slab_" .. subname, modname .. ":slab_" .. subname .. "_quarter"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_three_quarter",
- recipe = {modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter", modname .. ":slab_" .. subname .. "_quarter"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_three_quarter",
- recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
- })
- elseif alternate == "_2" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_2"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_2",
- recipe = {modname .. ":slab_" .. subname .. "_1", modname .. ":slab_" .. subname .. "_1"},
- })
- elseif alternate == "_14" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_14",
- recipe = {modname .. ":slab_" .. subname .. "_three_quarter", modname .. ":slab_" .. subname .. "_2"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_14",
- recipe = {modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2", modname .. ":slab_" .. subname .. "_2"},
- })
- elseif alternate == "_15" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slab_" .. subname .. "_15", modname .. ":slab_" .. subname .. "_1"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slab_" .. subname .. "_15",
- recipe = {modname .. ":slab_" .. subname .. "_14", modname .. ":slab_" .. subname .. "_1"},
- })
- end
- elseif category == "slope" then
- if alternate == "" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname},
- })
- elseif alternate == "_half" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
- modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
- })
- elseif alternate == "_outer" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_outer", modname .. ":slope_" .. subname .. "_inner"},
- })
- elseif alternate == "_outer_half" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_outer_half", modname .. ":slope_" .. subname .. "_inner_half_raised"},
- })
- elseif alternate == "_inner_half" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_outer_half_raised", modname .. ":slope_" .. subname .. "_inner_half"},
- })
- elseif alternate == "_outer_cut" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_inner_cut"},
- })
- elseif alternate == "_outer_cut_half" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_outer_cut_half", modname .. ":slope_" .. subname .. "_inner_cut_half_raised"},
- })
- elseif alternate == "_cut" then
- minetest.register_craft({
- type = "shapeless",
- output = recipeitem,
- recipe = {modname .. ":slope_" .. subname .. "_cut", modname .. ":slope_" .. subname .. "_cut"},
- })
- elseif alternate == "_half_raised" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slope_" .. subname .. "_half_raised",
- recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
- modname .. ":slope_" .. subname .. "_half"},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slope_" .. subname .. "_half_raised",
- recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"},
- })
- elseif alternate == "_inner_half_raised" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slope_" .. subname .. "_inner_half_raised",
- recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_half"},
- })
- elseif alternate == "_outer_half_raised" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slope_" .. subname .. "_outer_half_raised",
- recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_outer_half"},
- })
- elseif alternate == "_inner_cut_half_raised" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":slope_" .. subname .. "_inner_cut_half_raised",
- recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_inner_cut_half"},
- })
- end
- elseif category == "stair" then
- if alternate == "" then
- minetest.register_craft({
- output = modname .. ":stair_" .. subname .. " 8",
- recipe = {
- {recipeitem, "", ""},
- {recipeitem, recipeitem, ""},
- {recipeitem, recipeitem, recipeitem},
- },
- })
- minetest.register_craft({
- output = modname .. ":stair_" .. subname .. " 8",
- recipe = {
- {"", "", recipeitem},
- {"", recipeitem, recipeitem},
- {recipeitem, recipeitem, recipeitem},
- },
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname,
- recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname,
- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname,
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname,
- recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
- })
- elseif alternate == "_inner" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname .. "_inner",
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- elseif alternate == "_outer" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname .. "_outer",
- recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname .. "_outer",
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- elseif alternate == "_half" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname .. "_half",
- recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
- })
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname .. "_half",
- recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname},
- })
- elseif alternate == "_right_half" then
- minetest.register_craft({
- type = "shapeless",
- output = modname .. ":stair_" .. subname .. "_right_half",
- recipe = {modname .. ":stair_" .. subname .. "_half"},
- })
- elseif alternate == "_alt" then
- minetest.register_craft({ -- See mirrored variation of the recipe below.
- output = modname .. ":stair_" .. subname .. "_alt",
- recipe = {
- {modname .. ":panel_" .. subname, ""},
- {"" , modname .. ":panel_" .. subname},
- },
- })
- minetest.register_craft({ -- Mirrored variation of the recipe above.
- output = modname .. ":stair_" .. subname .. "_alt",
- recipe = {
- {"" , modname .. ":panel_" .. subname},
- {modname .. ":panel_" .. subname, ""},
- },
- })
- end
- end
- end
|