From 99e4b04e5584e4e897a274ed22bec5480a7b10bc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Feb 2017 17:20:58 +0100 Subject: [PATCH] Allow to set custom wall sounds --- mods/ITEMS/mcl_walls/init.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_walls/init.lua b/mods/ITEMS/mcl_walls/init.lua index 19242e99d8..fd579e9e66 100644 --- a/mods/ITEMS/mcl_walls/init.lua +++ b/mods/ITEMS/mcl_walls/init.lua @@ -87,8 +87,9 @@ local full_blocks = { * tiles: Wall textures table * invtex: Inventory image (optional) * groups: Base group memberships (optional, default is {cracky=3}) +* sounds: Sound table (optional, default is stone) ]] -function mcl_walls.register_wall(nodename, description, tiles, invtex, groups) +function mcl_walls.register_wall(nodename, description, tiles, invtex, groups, sounds) local base_groups = groups if not base_groups then @@ -102,6 +103,10 @@ function mcl_walls.register_wall(nodename, description, tiles, invtex, groups) main_node_groups = table.copy(base_groups) main_node_groups.deco_block = 1 + if not sounds then + sounds = mcl_sounds.node_sound_stone_defaults() + end + for i = 0, 15 do local need = {} local need_pillar = false @@ -144,7 +149,7 @@ function mcl_walls.register_wall(nodename, description, tiles, invtex, groups) type = "fixed", fixed = take }, - sounds = mcl_sounds.node_sound_stone_defaults(), + sounds = sounds, }) end @@ -163,7 +168,7 @@ function mcl_walls.register_wall(nodename, description, tiles, invtex, groups) type = "fixed", fixed = {pillar, full_blocks[1]} }, - sounds = mcl_sounds.node_sound_stone_defaults(), + sounds = sounds, }) minetest.register_node(nodename.."_21", { @@ -181,7 +186,7 @@ function mcl_walls.register_wall(nodename, description, tiles, invtex, groups) type = "fixed", fixed = {pillar, full_blocks[2]} }, - sounds = mcl_sounds.node_sound_stone_defaults(), + sounds = sounds, }) -- Inventory item @@ -204,7 +209,7 @@ function mcl_walls.register_wall(nodename, description, tiles, invtex, groups) }, collisionbox = {-0.2, 0, -0.2, 0.2, 1.4, 0.2}, on_construct = update_wall, - sounds = mcl_sounds.node_sound_stone_defaults(), + sounds = sounds, }) end