Use node sounds when none selected
If sounds is nil when registering stairs, node sounds can be used.
This commit is contained in:
parent
76cc86c827
commit
6ef30d87ab
|
@ -69,10 +69,10 @@ local function get_node_vars(nodename)
|
||||||
local def = minetest.registered_nodes[nodename]
|
local def = minetest.registered_nodes[nodename]
|
||||||
|
|
||||||
if def then
|
if def then
|
||||||
return def.light_source, def.use_texture_alpha, def.sunlight_propagates
|
return def.light_source, def.use_texture_alpha, def.sunlight_propagates, def.sounds
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil, nil, nil
|
return nil, nil, nil, nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Set backface culling and world-aligned textures
|
-- Set backface culling and world-aligned textures
|
||||||
|
@ -95,7 +95,7 @@ end
|
||||||
|
|
||||||
function stairs.register_stair(subname, recipeitem, groups, images, description,
|
function stairs.register_stair(subname, recipeitem, groups, images, description,
|
||||||
sounds, worldaligntex)
|
sounds, worldaligntex)
|
||||||
local light_source, texture_alpha, sunlight = get_node_vars(recipeitem)
|
local light, alpha, sunlight, node_sounds = get_node_vars(recipeitem)
|
||||||
local stair_images = set_textures(images, worldaligntex)
|
local stair_images = set_textures(images, worldaligntex)
|
||||||
local new_groups = table.copy(groups)
|
local new_groups = table.copy(groups)
|
||||||
new_groups.stair = 1
|
new_groups.stair = 1
|
||||||
|
@ -104,14 +104,14 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
|
||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
use_texture_alpha = texture_alpha,
|
use_texture_alpha = alpha,
|
||||||
sunlight_propagates = sunlight,
|
sunlight_propagates = sunlight,
|
||||||
light_source = light_source,
|
light_source = light,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = new_groups,
|
groups = new_groups,
|
||||||
sounds = sounds,
|
sounds = sounds or node_sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
@ -178,7 +178,7 @@ end
|
||||||
|
|
||||||
function stairs.register_slab(subname, recipeitem, groups, images, description,
|
function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||||
sounds, worldaligntex)
|
sounds, worldaligntex)
|
||||||
local light_source, texture_alpha, sunlight = get_node_vars(recipeitem)
|
local light, alpha, sunlight, mode_sounds = get_node_vars(recipeitem)
|
||||||
local slab_images = set_textures(images, worldaligntex)
|
local slab_images = set_textures(images, worldaligntex)
|
||||||
local new_groups = table.copy(groups)
|
local new_groups = table.copy(groups)
|
||||||
new_groups.slab = 1
|
new_groups.slab = 1
|
||||||
|
@ -187,14 +187,14 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
|
||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = slab_images,
|
tiles = slab_images,
|
||||||
use_texture_alpha = texture_alpha,
|
use_texture_alpha = alpha,
|
||||||
sunlight_propagates = sunlight,
|
sunlight_propagates = sunlight,
|
||||||
light_source = light_source,
|
light_source = light,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = new_groups,
|
groups = new_groups,
|
||||||
sounds = sounds,
|
sounds = sounds or node_sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
|
@ -301,7 +301,7 @@ end
|
||||||
|
|
||||||
function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
||||||
description, sounds, worldaligntex, full_description)
|
description, sounds, worldaligntex, full_description)
|
||||||
local light_source, texture_alpha, sunlight = get_node_vars(recipeitem)
|
local light, alpha, sunlight, node_sounds = get_node_vars(recipeitem)
|
||||||
local stair_images = set_textures(images, worldaligntex)
|
local stair_images = set_textures(images, worldaligntex)
|
||||||
local new_groups = table.copy(groups)
|
local new_groups = table.copy(groups)
|
||||||
new_groups.stair = 1
|
new_groups.stair = 1
|
||||||
|
@ -315,14 +315,14 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images,
|
||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
use_texture_alpha = texture_alpha,
|
use_texture_alpha = alpha,
|
||||||
sunlight_propagates = sunlight,
|
sunlight_propagates = sunlight,
|
||||||
light_source = light_source,
|
light_source = light,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = new_groups,
|
groups = new_groups,
|
||||||
sounds = sounds,
|
sounds = sounds or node_sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
@ -372,7 +372,7 @@ end
|
||||||
|
|
||||||
function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
||||||
description, sounds, worldaligntex, full_description)
|
description, sounds, worldaligntex, full_description)
|
||||||
local light_source, texture_alpha, sunlight = get_node_vars(recipeitem)
|
local light, alpha, sunlight, node_sounds = get_node_vars(recipeitem)
|
||||||
local stair_images = set_textures(images, worldaligntex)
|
local stair_images = set_textures(images, worldaligntex)
|
||||||
local new_groups = table.copy(groups)
|
local new_groups = table.copy(groups)
|
||||||
new_groups.stair = 1
|
new_groups.stair = 1
|
||||||
|
@ -386,14 +386,14 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images,
|
||||||
description = description,
|
description = description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
use_texture_alpha = texture_alpha,
|
use_texture_alpha = alpha,
|
||||||
sunlight_propagates = sunlight,
|
sunlight_propagates = sunlight,
|
||||||
light_source = light_source,
|
light_source = light,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = new_groups,
|
groups = new_groups,
|
||||||
sounds = sounds,
|
sounds = sounds or node_sounds,
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {
|
fixed = {
|
||||||
|
|
Loading…
Reference in New Issue