Fix cut woodframe glass if workbench is off

This commit is contained in:
Wuzzy 2023-06-30 20:40:17 +02:00
parent e4f91d5c71
commit d76b478b9f
4 changed files with 28 additions and 11 deletions

View File

@ -68,13 +68,31 @@ local function xdecor_stairs_alternative(nodename, def)
} }
) )
elseif minetest.get_modpath("stairs") then elseif minetest.get_modpath("stairs") then
stairs.register_stair_and_slab(name,nodename, local custom_tiles = xdecor.glasscuts[nodename]
def.groups, if custom_tiles and (custom_tiles.slab or custom_tiles.stair) then
def.tiles, if custom_tiles.stair then
S("@1 Stair", def.description), stairs.register_stair(name, nodename,
S("@1 Slab", def.description), def.groups, custom_tiles.stair, S("@1 Stair", def.description),
def.sounds def.sounds)
) stairs.register_stair_inner(name, nodename,
def.groups, custom_tiles.stair_inner, "", def.sounds, nil, S("Inner @1 Stair", def.description))
stairs.register_stair_outer(name, nodename,
def.groups, custom_tiles.stair_outer, "", def.sounds, nil, S("Outer @1 Stair", def.description))
end
if custom_tiles.slab then
stairs.register_slab(name, nodename,
def.groups, custom_tiles.slab, S("@1 Slab", def.description),
def.sounds)
end
else
stairs.register_stair_and_slab(name,nodename,
def.groups,
def.tiles,
S("@1 Stair", def.description),
S("@1 Slab", def.description),
def.sounds
)
end
end end
end end

View File

@ -3,6 +3,7 @@
xdecor = {} xdecor = {}
local modpath = minetest.get_modpath("xdecor") local modpath = minetest.get_modpath("xdecor")
dofile(modpath .. "/handlers/glasscut.lua")
dofile(modpath .. "/handlers/animations.lua") dofile(modpath .. "/handlers/animations.lua")
dofile(modpath .. "/handlers/helpers.lua") dofile(modpath .. "/handlers/helpers.lua")
dofile(modpath .. "/handlers/nodeboxes.lua") dofile(modpath .. "/handlers/nodeboxes.lua")

View File

@ -1,5 +1,3 @@
dofile(minetest.get_modpath("xdecor") .. "/src/glasscut.lua")
local workbench = {} local workbench = {}
local nodes = {} local nodes = {}
@ -325,9 +323,9 @@ for i = 1, #nodes do
groups, custom_tiles.stair, S("@1 Stair", def.description), groups, custom_tiles.stair, S("@1 Stair", def.description),
def.sounds) def.sounds)
stairs.register_stair_inner(item_name, node, stairs.register_stair_inner(item_name, node,
groups, custom_tiles.stair_inner, "", def.sounds) groups, custom_tiles.stair_inner, "", def.sounds, nil, S("Inner @1 Stair", def.description))
stairs.register_stair_outer(item_name, node, stairs.register_stair_outer(item_name, node,
groups, custom_tiles.stair_outer, "", def.sounds) groups, custom_tiles.stair_outer, "", def.sounds, nil, S("Outer @1 Stair", def.description))
end end
if custom_tiles.slab then if custom_tiles.slab then
stairs.register_slab(item_name, node, stairs.register_slab(item_name, node,