You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

local minetest, nodecore
= minetest, nodecore
local MOD_NAME = minetest.get_current_modname()
local STAIR_NODE_BOX = {
type = "fixed", fixed = {
{ -0.5, -0.5, -0.5, 0.5, 0.0, 0.5 },
{ -0.5, 0.0, 0.0, 0.5, 0.5, 0.5 },
},
}
local function do_the_cursed_thing(name, def)
local base_mod_name = name:gsub(":.*", "")
local base_name = name:gsub(".*:", "")
local stair_name = MOD_NAME .. ":" .. base_mod_name .. "__" .. base_name .. "_stair"
local stair_def = nodecore.underride({
description = def.description .. " Stair",
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = STAIR_NODE_BOX,
selection_box = STAIR_NODE_BOX,
sunlight_propagates = true,
groups = { stair = 1 },
}, def)
minetest.register_node(stair_name, stair_def)
end
local plank_name = "nc_woodwork:plank"
local plank_def = minetest.registered_nodes[plank_name]
do_the_cursed_thing(plank_name, plank_def)