Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
--[[
****
Stairs+
by Calinou
Version 12.06.18
****
--]]
stairsplus = {}
-- Node will be called stairsplus:stair_<subname>
function stairsplus.register_stair(subname, recipeitem, groups, images, description)
minetest.register_node("stairsplus:stair_" .. subname, {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("stairsplus:stair_" .. subname .. "_inverted", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, 0, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, 0, 0.5, 0, 0.5},
},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("stairsplus:stair_" .. subname .. "_wall", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, 0, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0, 0.5, 0},
},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. ' 8',
recipe = {
{recipeitem, "", ""},
{recipeitem, recipeitem, ""},
{recipeitem, recipeitem, recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. ' 8',
recipe = {
{"", "", recipeitem},
{"", recipeitem, recipeitem},
{recipeitem, recipeitem, recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. '_inverted' .. ' 8',
recipe = {
{recipeitem, recipeitem, recipeitem},
{recipeitem, recipeitem, ""},
{recipeitem, "", ""},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. '_inverted' .. ' 8',
recipe = {
{recipeitem, recipeitem, recipeitem},
{"", recipeitem, recipeitem},
{"", "", recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. '_inverted' .. ' 1',
recipe = {
{'stairsplus:stair_' .. subname},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. '_inverted' .. ' 1',
recipe = {
{'stairs:stair_' .. subname},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. ' 1',
recipe = {
{'stairsplus:stair_' .. subname .. '_inverted'},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. '_wall' .. ' 7',
recipe = {
{recipeitem, recipeitem, recipeitem},
{"", "", recipeitem},
{"", "", recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:stair_' .. subname .. '_wall' .. ' 7',
recipe = {
{recipeitem, recipeitem, recipeitem},
{recipeitem, "" , ""},
{recipeitem, "", ""},
},
})
end
-- Node will be called stairsplus:slab_<subname>
function stairsplus.register_slab(subname, recipeitem, groups, images, description)
minetest.register_node("stairsplus:slab_" .. subname, {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("stairsplus:slab_" .. subname .. "_inverted", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, 0, -0.5, 0.5, 0.5, 0.5},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("stairsplus:slab_" .. subname .. "_wall", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.5},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = 'stairsplus:slab_' .. subname .. ' 6',
recipe = {
{recipeitem, recipeitem, recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:slab_' .. subname .. '_wall' .. ' 6',
recipe = {
{recipeitem},
{recipeitem},
{recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:slab_' .. subname .. '_inverted' .. ' 1',
recipe = {
{'stairsplus:slab_' .. subname},
},
})
minetest.register_craft({
output = 'stairsplus:slab_' .. subname .. ' 1',
recipe = {
{'stairsplus:slab_' .. subname .. '_inverted'},
},
})
end
-- Node will be called stairsplus:panel_<subname>
function stairsplus.register_panel(subname, recipeitem, groups, images, description)
minetest.register_node("stairsplus:panel_" .. subname .. "_bottom", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("stairsplus:panel_" .. subname .. "_top", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, 0, 0, 0.5, 0.5, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, 0, 0, 0.5, 0.5, 0.5},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("stairsplus:panel_" .. subname .. "_vertical", {
description = description,
drawtype = "nodebox",
tiles = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0.5, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0, 0.5, 0.5},
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = 'stairsplus:panel_' .. subname .. '_bottom' .. ' 8',
recipe = {
{recipeitem, recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:panel_' .. subname .. '_vertical' .. ' 8',
recipe = {
{recipeitem},
{recipeitem},
},
})
minetest.register_craft({
output = 'stairsplus:panel_' .. subname .. '_top' .. ' 1',
recipe = {
{'stairsplus:panel_' .. subname .. '_bottom'},
},
})
minetest.register_craft({
output = 'stairsplus:panel_' .. subname .. '_bottom' .. ' 1',
recipe = {
{'stairsplus:panel_' .. subname .. '_top'},
},
})
end
-- Nodes will be called stairsplus:{stair,slab}_<subname>
function stairsplus.register_stair_and_slab_and_panel(subname, recipeitem, groups, images, desc_stair, desc_slab, desc_panel)
stairsplus.register_stair(subname, recipeitem, groups, images, desc_stair)
stairsplus.register_slab(subname, recipeitem, groups, images, desc_slab)
stairsplus.register_panel(subname, recipeitem, groups, images, desc_panel)
end
stairsplus.register_stair_and_slab_and_panel("wood", "default:wood",
{snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{"default_wood.png"},
"Wooden Stair",
"Wooden Slab",
"Wooden Panel")
stairsplus.register_stair_and_slab_and_panel("stone", "default:stone",
{cracky=3},
{"default_stone.png"},
"Stone Stair",
"Stone Slab",
"Stone Panel")
stairsplus.register_stair_and_slab_and_panel("cobble", "default:cobble",
{cracky=3},
{"default_cobble.png"},
"Cobblestone Stair",
"Cobblestone Slab",
"Cobblestone Panel")
stairsplus.register_stair_and_slab_and_panel("mossycobble", "default:mossycobble",
{cracky=3},
{"default_mossycobble.png"},
"Mossy Cobblestone Stair",
"Mossy Cobblestone Slab",
"Mossy Cobblestone Panel")
stairsplus.register_stair_and_slab_and_panel("brick", "default:brick",
{cracky=3},
{"default_brick.png"},
"Brick Stair",
"Brick Slab",
"Brick Panel")
stairsplus.register_stair_and_slab_and_panel("sandstone", "default:sandstone",
{crumbly=2,cracky=2},
{"default_sandstone.png"},
"Sandstone Stair",
"Sandstone Slab",
"Sandstone Panel")
stairsplus.register_stair_and_slab_and_panel("steelblock", "default:steelblock",
{snappy=1,bendy=2,cracky=1,melty=2,level=2},
{"default_steel_block.png"},
"Steel Block Stair",
"Steel Block Slab",
"Steel Block Panel")
stairsplus.register_stair_and_slab_and_panel("stonebrick", "moreblocks:stonebrick",
{cracky=3},
{"moreblocks_stonebrick.png"},
"Stone Bricks Stair",
"Stone Bricks Slab",
"Stone Bricks Panel")
stairsplus.register_stair_and_slab_and_panel("cactusbrick", "moreblocks:cactusbrick",
{cracky=3},
{"moreblocks_cactusbrick.png"},
"Cactus Brick Stair",
"Cactus Brick Slab",
"Cactus Brick Panel")
stairsplus.register_stair_and_slab_and_panel("cactuschecker", "moreblocks:cactuschecker",
{cracky=3},
{"moreblocks_cactuschecker.png"},
"Cactus Checker Stair",
"Cactus Checker Slab",
"Cactus Checker Panel")
stairsplus.register_stair_and_slab_and_panel("circlestonebrick", "moreblocks:circlestonebrick",
{cracky=3},
{"moreblocks_circlestonebrick.png"},
"Circlestone Brick Stair",
"Circlestone Brick Slab",
"Circlestone Brick Panel")
stairsplus.register_stair_and_slab_and_panel("coalchecker", "moreblocks:coalchecker",
{cracky=3},
{"moreblocks_coalchecker.png"},
"Coal Checker Stair",
"Coal Checker Slab",
"Coal Checker Panel")
stairsplus.register_stair_and_slab_and_panel("coalstone", "moreblocks:coalstone",
{cracky=3},
{"moreblocks_coalstone.png"},
"Coal Stone Stair",
"Coal Stone Slab",
"Coal Stone Panel")
stairsplus.register_stair_and_slab_and_panel("ironchecker", "moreblocks:ironchecker",
{cracky=3},
{"moreblocks_ironchecker.png"},
"Iron Checker Stair",
"Iron Checker Slab",
"Iron Checker Panel")
stairsplus.register_stair_and_slab_and_panel("ironstone", "moreblocks:ironstone",
{cracky=3},
{"moreblocks_ironstone.png"},
"Iron Stone Stair",
"Iron Stone Slab",
"Iron Stone Panel")
stairsplus.register_stair_and_slab_and_panel("ironstone", "moreblocks:ironstone",
{cracky=3},
{"moreblocks_ironstone.png"},
"Iron Stone Stair",
"Iron Stone Slab",
"Iron Stone Panel")
stairsplus.register_stair_and_slab_and_panel("ironstonebrick", "moreblocks:ironstonebrick",
{cracky=3},
{"moreblocks_ironstonebrick.png"},
"Iron Stonebrick Stair",
"Iron Stonebrick Slab",
"Iron Stonebrick Panel")
stairsplus.register_stair_and_slab_and_panel("junglewood", "moreblocks:junglewood",
{cracky=3},
{"moreblocks_junglewood.png"},
"Jungle Wood Stair",
"Jungle Wood Slab",
"Jungle Wood Panel")
stairsplus.register_stair_and_slab_and_panel("plankstone", "moreblocks:plankstone",
{cracky=3},
{"moreblocks_plankstone.png"},
"Plank Stone Stair",
"Plank Stone Slab",
"Plank Stone Panel")
stairsplus.register_stair_and_slab_and_panel("stonesquare", "moreblocks:stonesquare",
{cracky=3},
{"moreblocks_stonesquare.png"},
"Stone Square Stair",
"Stone Square Slab",
"Stone Square Panel")
stairsplus.register_stair_and_slab_and_panel("clear_wood", "kblocks:clear_wood",
{cracky=3},
{"clear_wood.png"},
"Clear Wood Stair",
"Clear Wood Slab",
"Clear Wood Panel")
stairsplus.register_stair_and_slab_and_panel("dark_wood", "kblocks:dark_wood",
{cracky=3},
{"dark_wood.png"},
"Dark Wood Stair",
"Dark Wood Slab",
"Dark Wood Panel")
stairsplus.register_stair_and_slab_and_panel("red_wood", "kblocks:red_wood",
{cracky=3},
{"red_wood.png"},
"Red Wood Stair",
"Red Wood Slab",
"Red Wood Panel")
stairsplus.register_stair_and_slab_and_panel("wool_black", "wool:wool_black",
{cracky=3},
{"wool_black.png"},
"Black Wool Stair",
"Black Wool Slab",
"Black Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_blue", "wool:wool_blue",
{cracky=3},
{"wool_blue.png"},
"Blue Wool Stair",
"Blue Wool Slab",
"Blue Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_brown", "wool:wool_brown",
{cracky=3},
{"wool_brown.png"},
"Brown Wool Stair",
"Brown Wool Slab",
"Brown Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_cyan", "wool:wool_cyan",
{cracky=3},
{"wool_cyan.png"},
"Cyan Wool Stair",
"Cyan Wool Slab",
"Cyan Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_green", "wool:wool_green",
{cracky=3},
{"wool_green.png"},
"Green Wool Stair",
"Green Wool Slab",
"Green Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_grey", "wool:wool_grey",
{cracky=3},
{"wool_grey.png"},
"Grey Wool Stair",
"Grey Wool Slab",
"Grey Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_lblue", "wool:wool_lblue",
{cracky=3},
{"wool_lblue.png"},
"LightBlue Wool Stair",
"LightBlue Wool Slab",
"LightBlue Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_lgreen", "wool:lgreen",
{cracky=3},
{"wool_lgreen.png"},
"LightGreen Wool Stair",
"LigthGreen Wool Slab",
"LightGreen Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_lgrey", "wool:lgrey",
{cracky=3},
{"wool_lgrey.png"},
"LightGrey Wool Stair",
"LightGrey Wool Slab",
"LightGrey Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_lmagenta", "wool:wool_lmagenta",
{cracky=3},
{"wool_lmagenta.png"},
"LightMagenta Wool Stair",
"LightMagenta Wool Slab",
"LightMagenta Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_magenta", "wool:wool_magenta",
{cracky=3},
{"wool_magenta.png"},
"Magenta Wool Stair",
"Magenta Wool Slab",
"Magenta Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_pink", "wool:wool_pink",
{cracky=3},
{"wool_pink.png"},
"Pink Wool Stair",
"Pink Wool Slab",
"Pink Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_orange", "wool:wool_orange",
{cracky=3},
{"wool_orange.png"},
"Orange Wool Stair",
"Orange Wool Slab",
"Orange Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_red", "wool:wool_red",
{cracky=3},
{"wool_red.png"},
"Red Wool Stair",
"Red Wool Slab",
"Red Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_white", "wool:wool_white",
{cracky=3},
{"wool_white.png"},
"White Wool Stair",
"White Wool Slab",
"White Wool Panel")
stairsplus.register_stair_and_slab_and_panel("wool_yellow", "wool:wool_yellow",
{cracky=3},
{"wool_yellow.png"},
"Yellow Wool Stair",
"Yellow Wool Slab",
"Yellow Wool Panel")