Added global stair fixing patch
This commit is contained in:
parent
e1be7b551d
commit
f297a002ad
|
@ -67,6 +67,7 @@ default.gui_survival_form = "size[8,8.5]"..
|
||||||
-- Load files
|
-- Load files
|
||||||
local default_path = minetest.get_modpath("default")
|
local default_path = minetest.get_modpath("default")
|
||||||
|
|
||||||
|
dofile(default_path.."/stairgate_hack.lua")
|
||||||
dofile(default_path.."/functions.lua")
|
dofile(default_path.."/functions.lua")
|
||||||
dofile(default_path.."/trees.lua")
|
dofile(default_path.."/trees.lua")
|
||||||
dofile(default_path.."/nodes.lua")
|
dofile(default_path.."/nodes.lua")
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
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
|
|
@ -24,10 +24,6 @@ minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
|
||||||
|
|
||||||
local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
|
local replace = minetest.settings:get_bool("enable_stairs_replace_abm")
|
||||||
|
|
||||||
-- Get setting for replace ABM
|
|
||||||
|
|
||||||
local walign_stairs = minetest.settings:get_bool("stairs_world_align")
|
|
||||||
|
|
||||||
local function rotate_and_place(itemstack, placer, pointed_thing)
|
local function rotate_and_place(itemstack, placer, pointed_thing)
|
||||||
local p0 = pointed_thing.under
|
local p0 = pointed_thing.under
|
||||||
local p1 = pointed_thing.above
|
local p1 = pointed_thing.above
|
||||||
|
@ -539,7 +535,7 @@ my_register_stair_and_slab(
|
||||||
"Wooden Stair",
|
"Wooden Stair",
|
||||||
"Wooden Slab",
|
"Wooden Slab",
|
||||||
default.node_sound_wood_defaults(),
|
default.node_sound_wood_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -550,7 +546,7 @@ my_register_stair_and_slab(
|
||||||
"Jungle Wood Stair",
|
"Jungle Wood Stair",
|
||||||
"Jungle Wood Slab",
|
"Jungle Wood Slab",
|
||||||
default.node_sound_wood_defaults(),
|
default.node_sound_wood_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -561,7 +557,7 @@ my_register_stair_and_slab(
|
||||||
"Pine Wood Stair",
|
"Pine Wood Stair",
|
||||||
"Pine Wood Slab",
|
"Pine Wood Slab",
|
||||||
default.node_sound_wood_defaults(),
|
default.node_sound_wood_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -572,7 +568,7 @@ my_register_stair_and_slab(
|
||||||
"Acacia Wood Stair",
|
"Acacia Wood Stair",
|
||||||
"Acacia Wood Slab",
|
"Acacia Wood Slab",
|
||||||
default.node_sound_wood_defaults(),
|
default.node_sound_wood_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -583,7 +579,7 @@ my_register_stair_and_slab(
|
||||||
"Aspen Wood Stair",
|
"Aspen Wood Stair",
|
||||||
"Aspen Wood Slab",
|
"Aspen Wood Slab",
|
||||||
default.node_sound_wood_defaults(),
|
default.node_sound_wood_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -627,7 +623,7 @@ my_register_stair_and_slab(
|
||||||
"Stone Brick Stair",
|
"Stone Brick Stair",
|
||||||
"Stone Brick Slab",
|
"Stone Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -671,7 +667,7 @@ my_register_stair_and_slab(
|
||||||
"Desert Stone Brick Stair",
|
"Desert Stone Brick Stair",
|
||||||
"Desert Stone Brick Slab",
|
"Desert Stone Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -704,7 +700,7 @@ my_register_stair_and_slab(
|
||||||
"Sandstone Brick Stair",
|
"Sandstone Brick Stair",
|
||||||
"Sandstone Brick Slab",
|
"Sandstone Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -737,7 +733,7 @@ my_register_stair_and_slab(
|
||||||
"Desert Sandstone Brick Stair",
|
"Desert Sandstone Brick Stair",
|
||||||
"Desert Sandstone Brick Slab",
|
"Desert Sandstone Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -770,7 +766,7 @@ my_register_stair_and_slab(
|
||||||
"Silver Sandstone Brick Stair",
|
"Silver Sandstone Brick Stair",
|
||||||
"Silver Sandstone Brick Slab",
|
"Silver Sandstone Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -803,7 +799,7 @@ my_register_stair_and_slab(
|
||||||
"Obsidian Brick Stair",
|
"Obsidian Brick Stair",
|
||||||
"Obsidian Brick Slab",
|
"Obsidian Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
@ -825,7 +821,7 @@ my_register_stair_and_slab(
|
||||||
"Brick Stair",
|
"Brick Stair",
|
||||||
"Brick Slab",
|
"Brick Slab",
|
||||||
default.node_sound_stone_defaults(),
|
default.node_sound_stone_defaults(),
|
||||||
walign_stairs
|
false
|
||||||
)
|
)
|
||||||
|
|
||||||
my_register_stair_and_slab(
|
my_register_stair_and_slab(
|
||||||
|
|
|
@ -79,3 +79,7 @@ enable_weather (Enable weather) bool true
|
||||||
# Fix stairs and slabs rendering by forcing all stair/slab types to
|
# Fix stairs and slabs rendering by forcing all stair/slab types to
|
||||||
# align with the world.
|
# align with the world.
|
||||||
stairs_world_align (World-align stairs) bool true
|
stairs_world_align (World-align stairs) bool true
|
||||||
|
|
||||||
|
# Ignore certain types of stairs when aligning to world
|
||||||
|
# Use a comma-separated list of stair types (with no spaces)
|
||||||
|
stairs_ignore (Ignore stairs types) string ""
|
||||||
|
|
Loading…
Reference in New Issue