diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 62b6973a..df213e30 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -116,7 +116,7 @@ core.register_entity(":__builtin:falling_node", { local meta = core.get_meta(np) meta:from_table(self.meta) end - if def.sounds and def.sounds.place and def.sounds.place.name then + if def.sounds and def.sounds.place then core.sound_play(def.sounds.place, {pos = np}) end end @@ -141,6 +141,11 @@ local function convert_to_falling_node(pos, node) local meta = core.get_meta(pos) local metatable = meta and meta:to_table() or {} + local def = core.registered_nodes[node.name] + if def and def.sounds and def.sounds.fall then + core.sound_play(def.sounds.fall, {pos = pos}) + end + obj:get_luaentity():set_node(node, metatable) core.remove_node(pos) return true @@ -170,6 +175,9 @@ local function drop_attached_node(p) drops = drop_stacks def.preserve_metadata(pos_copy, node_copy, oldmeta, drops) end + if def and def.sounds and def.sounds.fall then + core.sound_play(def.sounds.fall, {pos = p}) + end core.remove_node(p) for _, item in pairs(drops) do local pos = { diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 2edd0d9d..05ea6b4b 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -6084,6 +6084,7 @@ Used by `minetest.register_node`. dug = , place = , place_failed = , + fall = , }, drop = "",