game-antum/mods/buildings/stairsplus/panel.lua

154 lines
3.7 KiB
Lua

-- Node will be called <modname>panel_<subname>
function stairsplus.register_panel(modname, subname, recipeitem, groups, images, description, drop, sounds, sunlight)
--
-- nodes
--
minetest.register_node(modname .. ":panel_" .. subname .. "_bottom", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
sunlight_propagates = sunlight,
groups = groups,
drop = modname .. ":panel_" .. drop .. "_bottom",
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
},
sounds = sounds,
})
minetest.register_node(modname .. ":panel_" .. subname .. "_top", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
sunlight_propagates = sunlight,
groups = groups,
drop = modname .. ":panel_" .. drop .. "_top",
node_box = {
type = "fixed",
fixed = {-0.5, 0, 0, 0.5, 0.5, 0.5},
},
sounds = sounds,
})
minetest.register_node(modname .. ":panel_" .. subname .. "_vertical", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
sunlight_propagates = sunlight,
groups = groups,
drop = modname .. ":panel_" .. drop .. "_vertical",
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0.5, 0.5},
},
sounds = sounds,
})
--
-- crafting
--
minetest.register_craft({
output = modname .. ":panel_" .. subname .. "_bottom 8",
recipe = {
{recipeitem, recipeitem},
},
})
minetest.register_craft({
output = modname .. ":panel_" .. subname .. "_vertical 8",
recipe = {
{recipeitem},
{recipeitem},
},
})
minetest.register_craft({
output = recipeitem,
recipe = {
{modname .. ":panel_" .. subname .. "_bottom", modname .. ":panel_" .. subname .. "_bottom"},
{modname .. ":panel_" .. subname .. "_bottom", modname .. ":panel_" .. subname .. "_bottom"},
},
})
minetest.register_craft({
output = recipeitem,
recipe = {
{modname .. ":panel_" .. subname .. "_top", modname .. ":panel_" .. subname .. "_top"},
{modname .. ":panel_" .. subname .. "_top", modname .. ":panel_" .. subname .. "_top"},
},
})
minetest.register_craft({
output = recipeitem,
recipe = {
{modname .. ":panel_" .. subname .. "_vertical", modname .. ":panel_" .. subname .. "_vertical"},
{modname .. ":panel_" .. subname .. "_vertical", modname .. ":panel_" .. subname .. "_vertical"},
},
})
minetest.register_craft({
output = modname .. ":panel_" .. subname .. "_top 1",
recipe = {
{modname .. ":panel_" .. subname .. "_bottom"},
},
})
minetest.register_craft({
output = modname .. ":panel_" .. subname .. "_bottom 1",
recipe = {
{modname .. ":panel_" .. subname .. "_top"},
},
})
minetest.register_craft({
output = modname .. ":panel_" .. subname .. "_vertical 2",
recipe = {
{modname .. ":panel_" .. subname .. "_bottom"},
{modname .. ":panel_" .. subname .. "_bottom"},
},
})
minetest.register_craft({
output = modname .. ":panel_" .. subname .. "_bottom 2",
recipe = {
{modname .. ":panel_" .. subname .. "_vertical", modname .. ":panel_" .. subname .. "_vertical"},
},
})
--
-- cooking
--
minetest.register_craft({
type = "cooking",
output = modname .. ":panel_stone_bottom",
recipe = modname .. ":panel_cobble_bottom",
})
minetest.register_craft({
type = "cooking",
output = modname .. ":panel_stone_top",
recipe = modname .. ":panel_cobble_top",
})
minetest.register_craft({
type = "cooking",
output = modname .. ":panel_stone_vertical",
recipe = modname .. ":panel_cobble_vertical",
})
end