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.
23 lines
792 B
23 lines
792 B
local walign_stairs = minetest.settings:get_bool("stairs_world_align")
|
|
if not walign_stairs then
|
|
return
|
|
end
|
|
local stairs_ignore_str = minetest.settings:get("stairs_ignore") or ""
|
|
local stairs_ignore = {}
|
|
stairs_ignore_str:gsub("[^,]+",function(stairtype)
|
|
stairs_ignore[stairtype] = true
|
|
end)
|
|
minetest.___local_register_node = minetest.register_node
|
|
minetest.register_node = function(...)
|
|
local args = {...}
|
|
if (args[2].drawtype == "nodebox") and (args[1]:match("stair")) then
|
|
if not stairs_ignore[args[1]] then
|
|
for index,tile in pairs(args[2].tiles) do
|
|
if type(tile) == "table" then
|
|
tile.align_style = "world"
|
|
end
|
|
end
|
|
end
|
|
end
|
|
minetest.___local_register_node(unpack(args))
|
|
end
|