@@ -57,13 +57,24 @@ local function warn_if_exists(nodename)
57
57
end
58
58
end
59
59
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
60
71
61
72
-- Register stair
62
73
-- Node will be called stairs:stair_<subname>
63
74
64
75
function stairs .register_stair (subname , recipeitem , groups , images , description ,
65
76
sounds , worldaligntex )
66
- local src_def = minetest . registered_nodes [ recipeitem ]
77
+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
67
78
68
79
-- Set backface culling and world-aligned textures
69
80
local stair_images = {}
@@ -93,7 +104,9 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
93
104
description = description ,
94
105
drawtype = " nodebox" ,
95
106
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 ,
97
110
paramtype = " light" ,
98
111
paramtype2 = " facedir" ,
99
112
is_ground_content = false ,
165
178
166
179
function stairs .register_slab (subname , recipeitem , groups , images , description ,
167
180
sounds , worldaligntex )
168
- local src_def = minetest . registered_nodes [ recipeitem ]
181
+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
169
182
170
183
-- Set world-aligned textures
171
184
local slab_images = {}
@@ -191,7 +204,9 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
191
204
description = description ,
192
205
drawtype = " nodebox" ,
193
206
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 ,
195
210
paramtype = " light" ,
196
211
paramtype2 = " facedir" ,
197
212
is_ground_content = false ,
303
318
304
319
function stairs .register_stair_inner (subname , recipeitem , groups , images ,
305
320
description , sounds , worldaligntex , full_description )
306
- local src_def = minetest . registered_nodes [ recipeitem ]
321
+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
307
322
308
323
-- Set backface culling and world-aligned textures
309
324
local stair_images = {}
@@ -338,7 +353,9 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images,
338
353
description = description ,
339
354
drawtype = " nodebox" ,
340
355
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 ,
342
359
paramtype = " light" ,
343
360
paramtype2 = " facedir" ,
344
361
is_ground_content = false ,
393
410
394
411
function stairs .register_stair_outer (subname , recipeitem , groups , images ,
395
412
description , sounds , worldaligntex , full_description )
396
- local src_def = minetest . registered_nodes [ recipeitem ]
413
+ local light_source , texture_alpha , sunlight = get_node_vars ( recipeitem )
397
414
398
415
-- Set backface culling and world-aligned textures
399
416
local stair_images = {}
@@ -428,7 +445,9 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images,
428
445
description = description ,
429
446
drawtype = " nodebox" ,
430
447
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 ,
432
451
paramtype = " light" ,
433
452
paramtype2 = " facedir" ,
434
453
is_ground_content = false ,
0 commit comments