From 1a6298958e14782eca4feb51ef623479ddaaf9c6 Mon Sep 17 00:00:00 2001 From: Foz Date: Sun, 24 Apr 2016 18:10:46 -0400 Subject: [PATCH] Default: Add function 'node_sound_gravel_defaults()' --- mods/default/functions.lua | 12 ++++++++++++ mods/default/nodes.lua | 5 +---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index d0164cd..7e594b3 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -49,6 +49,18 @@ function default.node_sound_sand_defaults(table) return table end +function default.node_sound_gravel_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_gravel_footstep", gain = 0.5} + table.dug = table.dug or + {name = "default_gravel_footstep", gain = 1.0} + table.place = table.place or + {name = "default_place_node", gain = 1.0} + default.node_sound_defaults(table) + return table +end + function default.node_sound_wood_defaults(table) table = table or {} table.footstep = table.footstep or diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 506dd0a..9af3131 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -353,10 +353,7 @@ minetest.register_node("default:gravel", { description = "Gravel", tiles = {"default_gravel.png"}, groups = {crumbly = 2, falling_node = 1}, - sounds = default.node_sound_dirt_defaults({ - footstep = {name = "default_gravel_footstep", gain = 0.5}, - dug = {name = "default_gravel_footstep", gain = 1.0}, - }), + sounds = default.node_sound_gravel_defaults(), drop = { max_items = 1, items = {