@@ -57,13 +57,24 @@ local function warn_if_exists(nodename)
5757 end
5858end
5959
60+ -- get node settings to use for stairs
61+ local function get_node_vars (nodename )
62+
63+ local def = minetest .registered_nodes [nodename ]
64+
65+ if def then
66+ return def .light_source , def .use_texture_alpha , def .sunlight_propagates
67+ end
68+
69+ return nil , nil , nil
70+ end
6071
6172-- Register stair
6273-- Node will be called stairs:stair_<subname>
6374
6475function stairs .register_stair (subname , recipeitem , groups , images , description ,
6576 sounds , worldaligntex )
66- local src_def = minetest . registered_nodes [ recipeitem ]
77+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
6778
6879 -- Set backface culling and world-aligned textures
6980 local stair_images = {}
@@ -93,7 +104,9 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
93104 description = description ,
94105 drawtype = " nodebox" ,
95106 tiles = stair_images ,
96- use_texture_alpha = src_def and src_def .use_texture_alpha ,
107+ use_texture_alpha = texture_alpha ,
108+ sunlight_propagates = sunlight ,
109+ light_source = light_source ,
97110 paramtype = " light" ,
98111 paramtype2 = " facedir" ,
99112 is_ground_content = false ,
165178
166179function stairs .register_slab (subname , recipeitem , groups , images , description ,
167180 sounds , worldaligntex )
168- local src_def = minetest . registered_nodes [ recipeitem ]
181+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
169182
170183 -- Set world-aligned textures
171184 local slab_images = {}
@@ -191,7 +204,9 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
191204 description = description ,
192205 drawtype = " nodebox" ,
193206 tiles = slab_images ,
194- use_texture_alpha = src_def and src_def .use_texture_alpha ,
207+ use_texture_alpha = texture_alpha ,
208+ sunlight_propagates = sunlight ,
209+ light_source = light_source ,
195210 paramtype = " light" ,
196211 paramtype2 = " facedir" ,
197212 is_ground_content = false ,
303318
304319function stairs .register_stair_inner (subname , recipeitem , groups , images ,
305320 description , sounds , worldaligntex , full_description )
306- local src_def = minetest . registered_nodes [ recipeitem ]
321+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
307322
308323 -- Set backface culling and world-aligned textures
309324 local stair_images = {}
@@ -338,7 +353,9 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images,
338353 description = description ,
339354 drawtype = " nodebox" ,
340355 tiles = stair_images ,
341- use_texture_alpha = src_def and src_def .use_texture_alpha ,
356+ use_texture_alpha = texture_alpha ,
357+ sunlight_propagates = sunlight ,
358+ light_source = light_source ,
342359 paramtype = " light" ,
343360 paramtype2 = " facedir" ,
344361 is_ground_content = false ,
393410
394411function stairs .register_stair_outer (subname , recipeitem , groups , images ,
395412 description , sounds , worldaligntex , full_description )
396- local src_def = minetest . registered_nodes [ recipeitem ]
413+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
397414
398415 -- Set backface culling and world-aligned textures
399416 local stair_images = {}
@@ -428,7 +445,9 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images,
428445 description = description ,
429446 drawtype = " nodebox" ,
430447 tiles = stair_images ,
431- use_texture_alpha = src_def and src_def .use_texture_alpha ,
448+ use_texture_alpha = texture_alpha ,
449+ sunlight_propagates = sunlight ,
450+ light_source = light_source ,
432451 paramtype = " light" ,
433452 paramtype2 = " facedir" ,
434453 is_ground_content = false ,
0 commit comments