-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
local stairtable = { | ||
{ | ||
"slab", | ||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, | ||
}, | ||
{ | ||
"stair", | ||
{ | ||
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, | ||
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5}, | ||
}, | ||
}, | ||
{ | ||
"stair_inner", | ||
{ | ||
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, | ||
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5}, | ||
{-0.5, 0.0, -0.5, 0.0, 0.5, 0.0}, | ||
}, | ||
}, | ||
{ | ||
"stair_outer", | ||
{ | ||
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, | ||
{-0.5, 0.0, 0.0, 0.0, 0.5, 0.5}, | ||
}, | ||
}, | ||
} | ||
|
||
local function register(name, def) | ||
for _, sdef in pairs(stairtable) do | ||
local split = name:split(":") | ||
local ndef = table.copy(def) | ||
local item_name = ":" .. sdef[1] .. "_" .. split[2] | ||
|
||
ndef.description = def.description .. " " .. string.gsub(sdef[1], "_", " ") | ||
ndef.paramtype, ndef.paramtype2 = "light", "facedir" | ||
ndef.drawtype = "nodebox" | ||
ndef.node_box = { | ||
type = "fixed", | ||
fixed = sdef[2], | ||
} | ||
|
||
minetest.register_node(split[1] .. item_name, ndef) | ||
minetest.register_alias("stairs" .. item_name, split[1] .. item_name) | ||
end | ||
end | ||
|
||
minetest.log( | ||
"action", | ||
"[building_blocks]: depreciated legacy support for stairs loaded, please use moreblocks for stair support" | ||
) | ||
|
||
return register |