mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-01 07:30:43 +02:00
Move node registrations to a separate file
This commit is contained in:
@ -36,21 +36,8 @@ end
|
||||
|
||||
function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
||||
local defs = table.copy(stairsplus.defs["panel"])
|
||||
local desc = S("%s Panel"):format(fields.description)
|
||||
for alternate, def in pairs(defs) do
|
||||
for k, v in pairs(fields) do
|
||||
def[k] = v
|
||||
end
|
||||
def.drawtype = "nodebox"
|
||||
def.paramtype = "light"
|
||||
def.paramtype2 = def.paramtype2 or "facedir"
|
||||
def.on_place = minetest.rotate_node
|
||||
def.description = desc
|
||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||
if fields.drop and not (type(fields.drop) == "table") then
|
||||
def.drop = modname.. ":panel_" ..fields.drop..alternate
|
||||
end
|
||||
minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def)
|
||||
stairsplus.register_single("panel", alternate, def, modname, subname, recipeitem, fields)
|
||||
end
|
||||
minetest.register_alias(modname.. ":panel_" ..subname.. "_bottom", modname.. ":panel_" ..subname)
|
||||
|
||||
|
Reference in New Issue
Block a user