From c5e4ec5e27b876569c9254c275d701d2e589a0cc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 7 Apr 2020 00:55:45 +0200 Subject: [PATCH] Use ephemeral sounds --- mods/CORE/mcl_sounds/init.lua | 2 +- mods/CORE/mcl_util/init.lua | 2 +- mods/ENTITIES/drippingwater/init.lua | 4 ++-- mods/ENTITIES/mcl_falling_nodes/init.lua | 4 ++-- mods/ENTITIES/mcl_item_entity/init.lua | 6 +++--- mods/ENTITIES/mcl_minecarts/init.lua | 2 +- mods/ENTITIES/mcl_mobs/api.lua | 10 +++++----- mods/ENTITIES/mcl_mobs/mount.lua | 2 +- mods/ENTITIES/mobs_mc/1_items_default.lua | 2 +- mods/ENTITIES/mobs_mc/2_throwing.lua | 10 +++++----- mods/ENTITIES/mobs_mc/chicken.lua | 2 +- mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 2 +- mods/ENTITIES/mobs_mc/creeper.lua | 4 ++-- mods/ENTITIES/mobs_mc/ender_dragon.lua | 2 +- mods/ENTITIES/mobs_mc/enderman.lua | 4 ++-- mods/ENTITIES/mobs_mc/horse.lua | 4 ++-- mods/ENTITIES/mobs_mc/pig.lua | 4 ++-- mods/ENTITIES/mobs_mc/sheep.lua | 2 +- mods/ENTITIES/mobs_mc/snowman.lua | 2 +- mods/ENTITIES/mobs_mc/villager.lua | 12 ++++++------ mods/ENVIRONMENT/lightning/init.lua | 2 +- mods/ENVIRONMENT/mcl_weather/rain.lua | 2 +- mods/HELP/doc/doc/init.lua | 4 ++-- mods/HUD/awards/api.lua | 2 +- mods/ITEMS/REDSTONE/mesecons_button/init.lua | 6 +++--- mods/ITEMS/REDSTONE/mesecons_pistons/init.lua | 6 +++--- mods/ITEMS/REDSTONE/mesecons_torch/init.lua | 2 +- mods/ITEMS/REDSTONE/mesecons_walllever/init.lua | 6 +++--- mods/ITEMS/mcl_anvils/init.lua | 6 +++--- mods/ITEMS/mcl_armor/armor.lua | 2 +- mods/ITEMS/mcl_banners/init.lua | 4 ++-- mods/ITEMS/mcl_bows/arrow.lua | 4 ++-- mods/ITEMS/mcl_bows/bow.lua | 2 +- mods/ITEMS/mcl_buckets/init.lua | 8 ++++---- mods/ITEMS/mcl_cocoas/init.lua | 2 +- mods/ITEMS/mcl_core/functions.lua | 10 +++++----- mods/ITEMS/mcl_core/nodes_base.lua | 4 ++-- mods/ITEMS/mcl_core/nodes_climb.lua | 4 ++-- mods/ITEMS/mcl_doors/api_doors.lua | 4 ++-- mods/ITEMS/mcl_doors/api_trapdoors.lua | 4 ++-- mods/ITEMS/mcl_end/chorus_plant.lua | 6 +++--- mods/ITEMS/mcl_farming/hoes.lua | 4 ++-- mods/ITEMS/mcl_farming/shared_functions.lua | 2 +- mods/ITEMS/mcl_fences/init.lua | 4 ++-- mods/ITEMS/mcl_fire/flint_and_steel.lua | 5 +++-- mods/ITEMS/mcl_fire/init.lua | 6 +++--- mods/ITEMS/mcl_fishing/init.lua | 4 ++-- mods/ITEMS/mcl_flowers/init.lua | 4 ++-- mods/ITEMS/mcl_nether/nether_wart.lua | 2 +- mods/ITEMS/mcl_ocean/corals.lua | 2 +- mods/ITEMS/mcl_ocean/kelp.lua | 2 +- mods/ITEMS/mcl_ocean/seagrass.lua | 2 +- mods/ITEMS/mcl_portals/portal_end.lua | 4 ++-- mods/ITEMS/mcl_portals/portal_nether.lua | 2 +- mods/ITEMS/mcl_potions/init.lua | 6 +++--- mods/ITEMS/mcl_signs/init.lua | 2 +- mods/ITEMS/mcl_throwing/init.lua | 8 ++++---- mods/ITEMS/mcl_tnt/init.lua | 4 ++-- mods/ITEMS/mcl_tools/init.lua | 4 ++-- mods/ITEMS/mcl_torches/init.lua | 2 +- mods/PLAYER/mcl_hunger/hunger.lua | 4 ++-- 61 files changed, 123 insertions(+), 122 deletions(-) diff --git a/mods/CORE/mcl_sounds/init.lua b/mods/CORE/mcl_sounds/init.lua index 70010fda02..b4d43f0c8d 100644 --- a/mods/CORE/mcl_sounds/init.lua +++ b/mods/CORE/mcl_sounds/init.lua @@ -164,5 +164,5 @@ end -- Player death sound minetest.register_on_dieplayer(function(player) -- TODO: Add separate death sound - minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}) + minetest.sound_play({name="player_damage", gain = 1.0}, {pos=player:get_pos(), max_hear_distance=16}, true) end) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index b5d5e1bb80..6a74bb69ce 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -385,7 +385,7 @@ function mcl_util.generate_on_place_plant_function(condition) if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}, true) end end itemstack = new_itemstack diff --git a/mods/ENTITIES/drippingwater/init.lua b/mods/ENTITIES/drippingwater/init.lua index 46bfa1fa8c..730cb7b77d 100644 --- a/mods/ENTITIES/drippingwater/init.lua +++ b/mods/ENTITIES/drippingwater/init.lua @@ -39,7 +39,7 @@ minetest.register_entity("drippingwater:drop_water", { if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then self.object:remove() - minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}) + minetest.sound_play({name="drippingwater_drip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true) end end, }) @@ -81,7 +81,7 @@ minetest.register_entity("drippingwater:drop_lava", { if minetest.get_node({x=ownpos.x, y=ownpos.y -0.5, z=ownpos.z}).name ~= "air" then self.object:remove() - minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}) + minetest.sound_play({name="drippingwater_lavadrip"}, {pos = ownpos, gain = 0.5, max_hear_distance = 8}, true) end end, }) diff --git a/mods/ENTITIES/mcl_falling_nodes/init.lua b/mods/ENTITIES/mcl_falling_nodes/init.lua index 8fe4f17da3..1ffc87b34b 100644 --- a/mods/ENTITIES/mcl_falling_nodes/init.lua +++ b/mods/ENTITIES/mcl_falling_nodes/init.lua @@ -221,7 +221,7 @@ minetest.register_entity(":__builtin:falling_node", { meta:from_table(self.meta) end if def.sounds and def.sounds.place and def.sounds.place.name then - minetest.sound_play(def.sounds.place, {pos = np}) + minetest.sound_play(def.sounds.place, {pos = np}, true) end end else @@ -258,7 +258,7 @@ minetest.register_entity(":__builtin:falling_node", { def._mcl_after_falling(npos3, get_falling_depth(self)) end if def.sounds and def.sounds.place and def.sounds.place.name then - minetest.sound_play(def.sounds.place, {pos = np}) + minetest.sound_play(def.sounds.place, {pos = np}, true) end end deal_falling_damage(self, dtime) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 3c4810340b..689dfd3865 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -75,7 +75,7 @@ minetest.register_globalstep(function(dtime) pos = pos, max_hear_distance = 16, gain = 1.0, - }) + }, true) check_pickup_achievements(object, player) @@ -129,7 +129,7 @@ minetest.register_globalstep(function(dtime) pos = pos, max_hear_distance = 16, gain = 1.0, - }) + }, true) end check_pickup_achievements(object, player) object:get_luaentity()._removed = true @@ -545,7 +545,7 @@ minetest.register_entity(":__builtin:item", { local dg = minetest.get_item_group(nn, "destroys_items") if (def and (lg ~= 0 or fg ~= 0 or dg == 1)) then if dg ~= 2 then - minetest.sound_play("builtin_item_lava", {pos = self.object:get_pos(), gain = 0.5}) + minetest.sound_play("builtin_item_lava", {pos = self.object:get_pos(), gain = 0.5}, true) end self._removed = true self.object:remove() diff --git a/mods/ENTITIES/mcl_minecarts/init.lua b/mods/ENTITIES/mcl_minecarts/init.lua index 7c57334be3..14f70d246e 100644 --- a/mods/ENTITIES/mcl_minecarts/init.lua +++ b/mods/ENTITIES/mcl_minecarts/init.lua @@ -43,7 +43,7 @@ local function activate_tnt_minecart(self, timer) "mcl_minecarts_minecart.png", }}) self._blinktimer = tnt.BLINKTIMER - minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}) + minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}, true) end local activate_normal_minecart = detach_driver diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index f1de108682..aedabaa05d 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -130,7 +130,7 @@ local mob_sound = function(self, soundname, is_opinion, fixed_pitch) gain = 1.0, max_hear_distance = self.sounds.distance, pitch = pitch, - }) + }, true) self.opinion_sound_cooloff = 1 end end @@ -2230,7 +2230,7 @@ local do_states = function(self, dtime) pos = pos, gain = 1.0, max_hear_distance = self.sounds.distance or 32 - }) + }, true) entity_physics(pos, entity_damage_radius) effect(pos, 32, "tnt_smoke.png", nil, nil, node_break_radius, 1, 0) @@ -2683,12 +2683,12 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) minetest.sound_play(weapon:get_definition().sounds[s], { object = self.object, --hitter, max_hear_distance = 8 - }) + }, true) else minetest.sound_play("default_punch", { object = self.object, --hitter, max_hear_distance = 5 - }) + }, true) end damage_effect(self, damage) @@ -3797,7 +3797,7 @@ function mobs:safe_boom(self, pos, radius) pos = pos, gain = 1.0, max_hear_distance = self.sounds and self.sounds.distance or 32 - }) + }, true) entity_physics(pos, radius) effect(pos, 32, "tnt_smoke.png", radius * 3, radius * 5, radius, 1, 0) diff --git a/mods/ENTITIES/mcl_mobs/mount.lua b/mods/ENTITIES/mcl_mobs/mount.lua index a068131da2..8c4a6aa551 100644 --- a/mods/ENTITIES/mcl_mobs/mount.lua +++ b/mods/ENTITIES/mcl_mobs/mount.lua @@ -318,7 +318,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) minetest.sound_play("default_punch", { object = entity.object, max_hear_distance = 5 - }) + }, true) entity.object:punch(entity.object, 1.0, { full_punch_interval = 1.0, diff --git a/mods/ENTITIES/mobs_mc/1_items_default.lua b/mods/ENTITIES/mobs_mc/1_items_default.lua index 8d67823bf7..0929936430 100644 --- a/mods/ENTITIES/mobs_mc/1_items_default.lua +++ b/mods/ENTITIES/mobs_mc/1_items_default.lua @@ -568,7 +568,7 @@ if c("totem") then player:set_wielded_item(wield) end -- Effects - minetest.sound_play({name = "mcl_totems_totem", gain=1}, {pos=ppos, max_hear_distance=16}) + minetest.sound_play({name = "mcl_totems_totem", gain=1}, {pos=ppos, max_hear_distance=16}, true) -- Big totem overlay if not hud_totem[player:get_player_name()] then diff --git a/mods/ENTITIES/mobs_mc/2_throwing.lua b/mods/ENTITIES/mobs_mc/2_throwing.lua index f3b40691e3..e28d728f2b 100644 --- a/mods/ENTITIES/mobs_mc/2_throwing.lua +++ b/mods/ENTITIES/mobs_mc/2_throwing.lua @@ -85,7 +85,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "mobs_mc:arrow_entity" and obj:get_luaentity().name ~= "__builtin:item" then local damage = 3 - minetest.sound_play("damage", {pos = pos}) + minetest.sound_play("damage", {pos = pos}, true) obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=damage}, @@ -94,7 +94,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) end else local damage = 3 - minetest.sound_play("damage", {pos = pos}) + minetest.sound_play("damage", {pos = pos}, true) obj:punch(self.object, 1.0, { full_punch_interval=1.0, damage_groups={fleshy=damage}, @@ -106,7 +106,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime) if self.lastpos.x~=nil then if node.name ~= "air" then - minetest.sound_play("bowhit1", {pos = pos}) + minetest.sound_play("bowhit1", {pos = pos}, true) minetest.add_item(self.lastpos, 'mobs_mc:arrow') self.object:remove() end @@ -132,7 +132,7 @@ local throwing_shoot_arrow = function(itemstack, player) obj:set_velocity({x=dir.x*22, y=dir.y*22, z=dir.z*22}) obj:set_acceleration({x=dir.x*-3, y=-10, z=dir.z*-3}) obj:set_yaw(player:get_look_yaw()+math.pi) - minetest.sound_play("throwing_sound", {pos=playerpos}) + minetest.sound_play("throwing_sound", {pos=playerpos}, true) if obj:get_luaentity().player == "" then obj:get_luaentity().player = player end @@ -266,7 +266,7 @@ if c("egg") then pos = playerpos, gain = 1.0, max_hear_distance = 5, - }) + }, true) local obj = minetest.add_entity({ x = playerpos.x, diff --git a/mods/ENTITIES/mobs_mc/chicken.lua b/mods/ENTITIES/mobs_mc/chicken.lua index e5c9ba80b1..de1773c0d8 100644 --- a/mods/ENTITIES/mobs_mc/chicken.lua +++ b/mods/ENTITIES/mobs_mc/chicken.lua @@ -86,7 +86,7 @@ mobs:register_mob("mobs_mc:chicken", { pos = pos, gain = 1.0, max_hear_distance = 16, - }) + }, true) end, }) diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index c93ebec4cb..7b0e3d9b0f 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -87,7 +87,7 @@ mooshroom_def.on_rightclick = function(self, clicker) -- Use shears to get mushrooms and turn mooshroom into cow if item:get_name() == mobs_mc.items.shears then local pos = self.object:get_pos() - minetest.sound_play("shears", {pos = pos}) + minetest.sound_play("shears", {pos = pos}, true) if self.base_texture[1] == "mobs_mc_mooshroom_brown.png" then minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, mobs_mc.items.mushroom_brown .. " 5") diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 4bda7a7010..7add39b360 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -57,12 +57,12 @@ mobs:register_mob("mobs_mc:creeper", { item:add_wear(1000) -- Tool break sound if item:get_count() == 0 and wdef.sound and wdef.sound.breaks then - minetest.sound_play(wdef.sound.breaks, {pos = clicker:get_pos(), gain = 0.5}) + minetest.sound_play(wdef.sound.breaks, {pos = clicker:get_pos(), gain = 0.5}, true) end clicker:set_wielded_item(item) end self._forced_explosion_countdown_timer = self.explosion_timer - minetest.sound_play(self.sounds.attack, {pos = self.object:get_pos(), gain = 1, max_hear_distance = 16}) + minetest.sound_play(self.sounds.attack, {pos = self.object:get_pos(), gain = 1, max_hear_distance = 16}, true) end end, do_custom = function(self, dtime) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index 0d324bf699..87d7e8ab1b 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -81,7 +81,7 @@ mobs:register_arrow("mobs_mc:dragon_fireball", { end, hit_mob = function(self, mob) - minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5, max_hear_distance = 2*64}) + minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5, max_hear_distance = 2*64}, true) mob:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 12}, diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 124a2c9df5..4cb0bb89f9 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -255,7 +255,7 @@ mobs:register_mob("mobs_mc:enderman", { self.animation = select_enderman_animation("block") mobs:set_animation(self, self.animation.current) if def.sounds and def.sounds.dug then - minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16}) + minetest.sound_play(def.sounds.dug, {pos = take_pos, max_hear_distance = 16}, true) end end end @@ -276,7 +276,7 @@ mobs:register_mob("mobs_mc:enderman", { self.animation = select_enderman_animation("normal") mobs:set_animation(self, self.animation.current) if def.sounds and def.sounds.place then - minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16}) + minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16}, true) end self._taken_node = "" end diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index c9a8a76607..46fd14197e 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -245,7 +245,7 @@ local horse = { local tex = horse_extra_texture(self) self.base_texture = tex self.object:set_properties({textures = self.base_texture}) - minetest.sound_play({name = "mcl_armor_equip_leather"}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}) + minetest.sound_play({name = "mcl_armor_equip_leather"}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}, true) -- Put on horse armor if tamed elseif can_equip_horse_armor(self.name) and not self.driver and not self._horse_armor @@ -277,7 +277,7 @@ local horse = { self.object:set_properties({textures = self.base_texture}) local def = w:get_definition() if def.sounds and def.sounds._mcl_armor_equip then - minetest.sound_play({name = def.sounds._mcl_armor_equip}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}) + minetest.sound_play({name = def.sounds._mcl_armor_equip}, {gain=0.5, max_hear_distance=12, pos=self.object:get_pos()}, true) end -- Mount horse diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 1d9c56b1b8..b8ded19bc2 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -125,7 +125,7 @@ mobs:register_mob("mobs_mc:pig", { stack:take_item() inv:set_stack("main", clicker:get_wield_index(), stack) end - minetest.sound_play({name = "mcl_armor_equip_leather"}, {gain=0.5, max_hear_distance=8, pos=self.object:get_pos()}) + minetest.sound_play({name = "mcl_armor_equip_leather"}, {gain=0.5, max_hear_distance=8, pos=self.object:get_pos()}, true) return end @@ -149,7 +149,7 @@ mobs:register_mob("mobs_mc:pig", { -- Break carrot on a stick local def = wielditem:get_definition() if def.sounds and def.sounds.breaks then - minetest.sound_play(def.sounds.breaks, {pos = clicker:get_pos(), max_hear_distance = 8, gain = 0.5}) + minetest.sound_play(def.sounds.breaks, {pos = clicker:get_pos(), max_hear_distance = 8, gain = 0.5}, true) end wielditem = {name = mobs_mc.items.fishing_rod, count = 1} else diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 1e25455705..1747d3caec 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -155,7 +155,7 @@ mobs:register_mob("mobs_mc:sheep", { if item:get_name() == mobs_mc.items.shears and not self.gotten and not self.child then self.gotten = true local pos = self.object:get_pos() - minetest.sound_play("shears", {pos = pos}) + minetest.sound_play("shears", {pos = pos}, true) pos.y = pos.y + 0.5 if not self.color then self.color = "unicolor_white" diff --git a/mods/ENTITIES/mobs_mc/snowman.lua b/mods/ENTITIES/mobs_mc/snowman.lua index 7e74d8d62c..d645d6b2e5 100644 --- a/mods/ENTITIES/mobs_mc/snowman.lua +++ b/mods/ENTITIES/mobs_mc/snowman.lua @@ -115,7 +115,7 @@ mobs:register_mob("mobs_mc:snowman", { }) local pos = self.object:get_pos() - minetest.sound_play("shears", {pos = pos}) + minetest.sound_play("shears", {pos = pos}, true) -- Wear out if not minetest.settings:get_bool("creative_mode") then diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 592c8ed6cd..6432a87a80 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -518,7 +518,7 @@ local function show_trade_formspec(playername, trader, tradenum) .."listring[current_player;main]" .."listring["..tradeinv..";input]" .."listring[current_player;main]" - minetest.sound_play("mobs_mc_villager_trade", {to_player = playername}) + minetest.sound_play("mobs_mc_villager_trade", {to_player = playername}, true) minetest.show_formspec(playername, tradeinv_name, formspec) end @@ -580,13 +580,13 @@ local update_offer = function(inv, player, sound) (trade.locked == false)) then inv:set_stack("output", 1, inv:get_stack("offered", 1)) if sound then - minetest.sound_play("mobs_mc_villager_accept", {to_player = name}) + minetest.sound_play("mobs_mc_villager_accept", {to_player = name}, true) end return true else inv:set_stack("output", 1, ItemStack("")) if sound then - minetest.sound_play("mobs_mc_villager_deny", {to_player = name}) + minetest.sound_play("mobs_mc_villager_deny", {to_player = name}, true) end return false end @@ -775,7 +775,7 @@ local trade_inventory = { if not wanted2:is_empty() then inv:remove_item("input", inv:get_stack("wanted", 2)) end - minetest.sound_play("mobs_mc_villager_accept", {to_player = player:get_player_name()}) + minetest.sound_play("mobs_mc_villager_accept", {to_player = player:get_player_name()}, true) end update_offer(inv, player, true) end, @@ -881,9 +881,9 @@ local trade_inventory = { update_offer(inv, player, false) end if accept then - minetest.sound_play("mobs_mc_villager_accept", {to_player = name}) + minetest.sound_play("mobs_mc_villager_accept", {to_player = name}, true) else - minetest.sound_play("mobs_mc_villager_deny", {to_player = name}) + minetest.sound_play("mobs_mc_villager_deny", {to_player = name}, true) end end, } diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index 6ed0fafc00..ae7c770047 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -120,7 +120,7 @@ lightning.strike = function(pos) glow = minetest.LIGHT_MAX, }) - minetest.sound_play({ pos = pos, name = "lightning_thunder", gain = 10, max_hear_distance = 500 }) + minetest.sound_play({ pos = pos, name = "lightning_thunder", gain = 10, max_hear_distance = 500 }, true) -- damage nearby objects, transform mobs local objs = minetest.get_objects_inside_radius(pos2, 3.5) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 6f88220d56..cb39daebc0 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -207,7 +207,7 @@ if mcl_weather.allow_abm then if mcl_weather.rain.raining and mcl_weather.rain.extinguish_fire then if mcl_weather.is_outdoor(pos) then minetest.remove_node(pos) - minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true) end end end, diff --git a/mods/HELP/doc/doc/init.lua b/mods/HELP/doc/doc/init.lua index 70834fa839..360cc149cd 100644 --- a/mods/HELP/doc/doc/init.lua +++ b/mods/HELP/doc/doc/init.lua @@ -191,7 +191,7 @@ function doc.mark_entry_as_revealed(playername, category_id, entry_id) local last_sound = doc.data.players[playername].last_reveal_sound if last_sound == nil or os.difftime(os.time(), last_sound) >= 1 then -- Play notification sound - minetest.sound_play({ name = "doc_reveal", gain = 0.2 }, { to_player = playername }) + minetest.sound_play({ name = "doc_reveal", gain = 0.2 }, { to_player = playername }, true) doc.data.players[playername].last_reveal_sound = os.time() end end @@ -224,7 +224,7 @@ function doc.mark_all_entries_as_revealed(playername) msg = S("All help entries revealed!") -- Play notification sound (ignore sound limit intentionally) - minetest.sound_play({ name = "doc_reveal", gain = 0.2 }, { to_player = playername }) + minetest.sound_play({ name = "doc_reveal", gain = 0.2 }, { to_player = playername }, true) doc.data.players[playername].last_reveal_sound = os.time() else msg = S("All help entries are already revealed.") diff --git a/mods/HUD/awards/api.lua b/mods/HUD/awards/api.lua index c4367ba8f7..0722041748 100644 --- a/mods/HUD/awards/api.lua +++ b/mods/HUD/awards/api.lua @@ -264,7 +264,7 @@ function awards.unlock(name, award) -- Enforce sound delay to prevent sound spamming local lastsound = awards.players[name].lastsound if lastsound == nil or os.difftime(os.time(), lastsound) >= 1 then - minetest.sound_play(sound, {to_player=name}) + minetest.sound_play(sound, {to_player=name}, true) awards.players[name].lastsound = os.time() end end diff --git a/mods/ITEMS/REDSTONE/mesecons_button/init.lua b/mods/ITEMS/REDSTONE/mesecons_button/init.lua index 30339858bb..e1a5c5980c 100644 --- a/mods/ITEMS/REDSTONE/mesecons_button/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_button/init.lua @@ -27,7 +27,7 @@ mesecon.push_button = function(pos, node) local def = minetest.registered_nodes[node.name] minetest.set_node(pos, {name="mesecons_button:button_"..def._mcl_button_basename.."_on", param2=node.param2}) mesecon.receptor_on(pos, button_get_output_rules(node)) - minetest.sound_play("mesecons_button_push", {pos=pos}) + minetest.sound_play("mesecons_button_push", {pos=pos}, true) local timer = minetest.get_node_timer(pos) timer:start(def._mcl_button_timer) end @@ -73,7 +73,7 @@ local on_button_place = function(itemstack, placer, pointed_thing) if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true) end end return itemstack @@ -179,7 +179,7 @@ mesecon.register_button = function(basename, description, texture, recipeitem, s -- Normal operation: Un-press the button minetest.set_node(pos, {name="mesecons_button:button_"..basename.."_off",param2=node.param2}) - minetest.sound_play("mesecons_button_pop", {pos=pos}) + minetest.sound_play("mesecons_button_pop", {pos=pos}, true) mesecon.receptor_off(pos, button_get_output_rules(node)) end end, diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua index 3800814743..8536cff9ac 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua @@ -64,7 +64,7 @@ local piston_remove_pusher = function (pos, oldnode) pos = pos, max_hear_distance = 31, gain = 0.3, - }) + }, true) end end @@ -85,7 +85,7 @@ local piston_remove_base = function (pos, oldnode) pos = pos, max_hear_distance = 31, gain = 0.3, - }) + }, true) end end @@ -108,7 +108,7 @@ local piston_on = function (pos, node) pos = pos, max_hear_distance = 31, gain = 0.3, - }) + }, true) end end diff --git a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua index 4433561344..fda96121f2 100644 --- a/mods/ITEMS/REDSTONE/mesecons_torch/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_torch/init.lua @@ -50,7 +50,7 @@ local torch_get_input_rules = function(node) end local torch_overheated = function(pos) - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.02, max_hear_distance = 6}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.02, max_hear_distance = 6}, true) minetest.add_particle({ pos = {x=pos.x, y=pos.y+0.2, z=pos.z}, velocity = {x = 0, y = 0.6, z = 0}, diff --git a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua index 09dd768bf7..8894f4ad1e 100644 --- a/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_walllever/init.lua @@ -53,7 +53,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { on_rightclick = function (pos, node) minetest.swap_node(pos, {name="mesecons_walllever:wall_lever_on", param2=node.param2}) mesecon.receptor_on(pos, lever_get_output_rules(node)) - minetest.sound_play("mesecons_lever", {pos=pos}) + minetest.sound_play("mesecons_lever", {pos=pos}, true) end, node_placement_prediction = "", on_place = function(itemstack, placer, pointed_thing) @@ -116,7 +116,7 @@ minetest.register_node("mesecons_walllever:wall_lever_off", { if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true) end end return itemstack @@ -152,7 +152,7 @@ minetest.register_node("mesecons_walllever:wall_lever_on", { on_rightclick = function (pos, node) minetest.swap_node(pos, {name="mesecons_walllever:wall_lever_off", param2=node.param2}) mesecon.receptor_off(pos, lever_get_output_rules(node)) - minetest.sound_play("mesecons_lever", {pos=pos}) + minetest.sound_play("mesecons_lever", {pos=pos}, true) end, sounds = mcl_sounds.node_sound_stone_defaults(), mesecons = {receptor = { diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index f2be3b852c..76cd0f3ee0 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -220,17 +220,17 @@ local function damage_anvil(pos) local new if node.name == "mcl_anvils:anvil" then minetest.swap_node(pos, {name="mcl_anvils:anvil_damage_1", param2=node.param2}) - minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}) + minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}, true) return false elseif node.name == "mcl_anvils:anvil_damage_1" then minetest.swap_node(pos, {name="mcl_anvils:anvil_damage_2", param2=node.param2}) - minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}) + minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dig, {pos=pos, max_hear_distance=16}, true) return false elseif node.name == "mcl_anvils:anvil_damage_2" then -- Destroy anvil local meta = minetest.get_meta(pos) drop_anvil_items(pos, meta) - minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dug, {pos=pos, max_hear_distance=16}) + minetest.sound_play(mcl_sounds.node_sound_metal_defaults().dug, {pos=pos, max_hear_distance=16}, true) minetest.remove_node(pos) minetest.check_single_for_falling({x=pos.x, y=pos.y+1, z=pos.z}) return true diff --git a/mods/ITEMS/mcl_armor/armor.lua b/mods/ITEMS/mcl_armor/armor.lua index ebed8208e1..7edd77c2ff 100644 --- a/mods/ITEMS/mcl_armor/armor.lua +++ b/mods/ITEMS/mcl_armor/armor.lua @@ -322,7 +322,7 @@ armor.play_equip_sound = function(self, stack, player, pos, unequip) if pos then dist = 16 end - minetest.sound_play(snd, {object=player, pos=pos, gain=0.5, max_hear_distance=dist}) + minetest.sound_play(snd, {object=player, pos=pos, gain=0.5, max_hear_distance=dist}, true) end end diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 4b5220212a..8c8869d60f 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -376,7 +376,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do minetest.set_node(pointed_thing.under, {name=new_node}) -- Play sound (from mcl_potions mod) - minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}) + minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) return itemstack end @@ -458,7 +458,7 @@ for colorid, colortab in pairs(mcl_banners.colors) do if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end - minetest.sound_play({name="default_place_node_hard", gain=1.0}, {pos = place_pos}) + minetest.sound_play({name="default_place_node_hard", gain=1.0}, {pos = place_pos}, true) return itemstack end, diff --git a/mods/ITEMS/mcl_bows/arrow.lua b/mods/ITEMS/mcl_bows/arrow.lua index 80c1160b84..9ae6e85a4b 100644 --- a/mods/ITEMS/mcl_bows/arrow.lua +++ b/mods/ITEMS/mcl_bows/arrow.lua @@ -145,7 +145,7 @@ ARROW_ENTITY.on_step = function(self, dtime) pos = pos, max_hear_distance = 16, gain = 1.0, - }) + }, true) end end self.object:remove() @@ -224,7 +224,7 @@ ARROW_ENTITY.on_step = function(self, dtime) if is_player then if self._shooter and self._shooter:is_player() then -- “Ding” sound for hitting another player - minetest.sound_play({name="mcl_bows_hit_player", gain=0.1}, {to_player=self._shooter}) + minetest.sound_play({name="mcl_bows_hit_player", gain=0.1}, {to_player=self._shooter}, true) end end diff --git a/mods/ITEMS/mcl_bows/bow.lua b/mods/ITEMS/mcl_bows/bow.lua index 30292f4fec..9b64bd5142 100644 --- a/mods/ITEMS/mcl_bows/bow.lua +++ b/mods/ITEMS/mcl_bows/bow.lua @@ -48,7 +48,7 @@ mcl_bows.shoot_arrow = function(arrow_item, pos, dir, yaw, shooter, power, damag le._shooter = shooter le._damage = damage le._startpos = pos - minetest.sound_play("mcl_bows_bow_shoot", {pos=pos}) + minetest.sound_play("mcl_bows_bow_shoot", {pos=pos}, true) if shooter ~= nil and shooter:is_player() then if obj:get_luaentity().player == "" then obj:get_luaentity().player = shooter diff --git a/mods/ITEMS/mcl_buckets/init.lua b/mods/ITEMS/mcl_buckets/init.lua index b6e7ed002f..e7da54a097 100644 --- a/mods/ITEMS/mcl_buckets/init.lua +++ b/mods/ITEMS/mcl_buckets/init.lua @@ -28,14 +28,14 @@ mcl_buckets.liquids = {} local sound_place = function(itemname, pos) local def = minetest.registered_nodes[itemname] if def and def.sounds and def.sounds.place then - minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}) + minetest.sound_play(def.sounds.place, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) end end local sound_take = function(itemname, pos) local def = minetest.registered_nodes[itemname] if def and def.sounds and def.sounds.dug then - minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}) + minetest.sound_play(def.sounds.dug, {gain=1.0, pos = pos, pitch = 1 + math.random(-10, 10)*0.005}, true) end end @@ -346,7 +346,7 @@ if mod_mcl_core then else local dim = mcl_worlds.pos_to_dimension(pos) if dim == "nether" then - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) return false end end @@ -389,7 +389,7 @@ if mod_mclx_core then -- Evaporate water if used in Nether (except on cauldron) local dim = mcl_worlds.pos_to_dimension(pos) if dim == "nether" then - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) return false end end diff --git a/mods/ITEMS/mcl_cocoas/init.lua b/mods/ITEMS/mcl_cocoas/init.lua index 047e127750..7f809fc06f 100644 --- a/mods/ITEMS/mcl_cocoas/init.lua +++ b/mods/ITEMS/mcl_cocoas/init.lua @@ -43,7 +43,7 @@ function mcl_cocoas.place(itemstack, placer, pointed_thing, plantname) -- Add the node, set facedir and remove 1 item from the itemstack minetest.set_node(pt.above, {name = plantname, param2 = minetest.dir_to_facedir(clickdir)}) - minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) + minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}, true) if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 47ac054986..fb15e9c848 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -21,21 +21,21 @@ minetest.register_abm({ -- Lava on top of water: Water turns into stone if water[w].y < pos.y and water[w].x == pos.x and water[w].z == pos.z then minetest.set_node(water[w], {name="mcl_core:stone"}) - minetest.sound_play("fire_extinguish_flame", {pos = water[w], gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = water[w], gain = 0.25, max_hear_distance = 16}, true) -- Flowing lava vs water on same level: Lava turns into cobblestone elseif lavatype == "flowing" and water[w].y == pos.y and (water[w].x == pos.x or water[w].z == pos.z) then minetest.set_node(pos, {name="mcl_core:cobble"}) - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) -- Lava source vs flowing water above or horizontally neighbored: Lava turns into obsidian elseif lavatype == "source" and ((water[w].y > pos.y and water[w].x == pos.x and water[w].z == pos.z) or (water[w].y == pos.y and (water[w].x == pos.x or water[w].z == pos.z))) then minetest.set_node(pos, {name="mcl_core:obsidian"}) - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) -- Flowing water above flowing lava: Lava turns into cobblestone elseif watertype == "flowing" and lavatype == "flowing" and water[w].y > pos.y and water[w].x == pos.x and water[w].z == pos.z then minetest.set_node(pos, {name="mcl_core:cobble"}) - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) end end end, @@ -166,7 +166,7 @@ minetest.register_abm({ action = function(pos, node, active_object_count, active_object_count_wider) liquid_flow_action(pos, "lava", function(pos) minetest.remove_node(pos) - minetest.sound_play("builtin_item_lava", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("builtin_item_lava", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) core.check_for_falling(pos) end) end, diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index df06c44b73..6c47dd3f36 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -922,7 +922,7 @@ for i=1,8 do fakestack:set_name("mcl_core:snow_"..math.min(8, (i+g))) local success itemstack, success = minetest.item_place(fakestack, placer, pointed_thing) - minetest.sound_play(mcl_sounds.node_sound_snow_defaults().place, {pos = below}) + minetest.sound_play(mcl_sounds.node_sound_snow_defaults().place, {pos = below}, true) itemstack:set_name(itemstring) return itemstack end @@ -932,7 +932,7 @@ for i=1,8 do local bnode = minetest.get_node(below) if minetest.get_item_group(bnode.name, "solid") == 1 then - minetest.sound_play(mcl_sounds.node_sound_snow_defaults().place, {pos = below}) + minetest.sound_play(mcl_sounds.node_sound_snow_defaults().place, {pos = below}, true) return minetest.item_place_node(itemstack, placer, pointed_thing) else return itemstack diff --git a/mods/ITEMS/mcl_core/nodes_climb.lua b/mods/ITEMS/mcl_core/nodes_climb.lua index 9e372d4a5a..5167d08281 100644 --- a/mods/ITEMS/mcl_core/nodes_climb.lua +++ b/mods/ITEMS/mcl_core/nodes_climb.lua @@ -75,7 +75,7 @@ minetest.register_node("mcl_core:ladder", { if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true) end end return itemstack @@ -146,7 +146,7 @@ minetest.register_node("mcl_core:vine", { if success then if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=above, gain=1}, true) end end return itemstack diff --git a/mods/ITEMS/mcl_doors/api_doors.lua b/mods/ITEMS/mcl_doors/api_doors.lua index 6c78dd0026..f3943460e4 100644 --- a/mods/ITEMS/mcl_doors/api_doors.lua +++ b/mods/ITEMS/mcl_doors/api_doors.lua @@ -155,7 +155,7 @@ function mcl_doors:register_door(name, def) minetest.set_node(pt2, {name=name.."_t_1", param2=p2}) if def.sounds and def.sounds.place then - minetest.sound_play(def.sounds.place, {pos=pt}) + minetest.sound_play(def.sounds.place, {pos=pt}, true) end if def.only_placer_can_open then @@ -225,7 +225,7 @@ function mcl_doors:register_door(name, def) meta1:set_int("is_open", 1) meta2:set_int("is_open", 1) end - minetest.sound_play(door_switching_sound, {pos = pos, gain = 0.5, max_hear_distance = 16}) + minetest.sound_play(door_switching_sound, {pos = pos, gain = 0.5, max_hear_distance = 16}, true) end local function on_mesecons_signal_open(pos, node) diff --git a/mods/ITEMS/mcl_doors/api_trapdoors.lua b/mods/ITEMS/mcl_doors/api_trapdoors.lua index 11948ba89d..a7ca6cb159 100644 --- a/mods/ITEMS/mcl_doors/api_trapdoors.lua +++ b/mods/ITEMS/mcl_doors/api_trapdoors.lua @@ -67,11 +67,11 @@ function mcl_doors:register_trapdoor(name, def) local tmp_node -- Close if minetest.get_item_group(me.name, "trapdoor") == 2 then - minetest.sound_play(def.sound_close, {pos = pos, gain = 0.3, max_hear_distance = 16}) + minetest.sound_play(def.sound_close, {pos = pos, gain = 0.3, max_hear_distance = 16}, true) tmp_node = {name=name, param1=me.param1, param2=me.param2} -- Open else - minetest.sound_play(def.sound_open, {pos = pos, gain = 0.3, max_hear_distance = 16}) + minetest.sound_play(def.sound_open, {pos = pos, gain = 0.3, max_hear_distance = 16}, true) tmp_node = {name=name.."_open", param1=me.param1, param2=me.param2} end minetest.set_node(pos, tmp_node) diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index b80babf60e..e29a6fecd1 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -191,7 +191,7 @@ minetest.register_node("mcl_end:chorus_flower", { -- Placement OK! Proceed normally local it, suc = minetest.item_place_node(itemstack, placer, pointed_thing) if suc then - minetest.sound_play(mcl_sounds.node_sound_wood_defaults().place, {pos = pos}) + minetest.sound_play(mcl_sounds.node_sound_wood_defaults().place, {pos = pos}, true) end return it else @@ -295,7 +295,7 @@ minetest.register_node("mcl_end:chorus_plant", { -- Placement OK! Proceed normally local it, suc = minetest.item_place_node(itemstack, placer, pointed_thing) if suc then - minetest.sound_play(mcl_sounds.node_sound_wood_defaults().place, {pos = pos_place}) + minetest.sound_play(mcl_sounds.node_sound_wood_defaults().place, {pos = pos_place}, true) end return it else @@ -516,7 +516,7 @@ local random_teleport = function(player) -- JACKPOT! Now we can teleport. local goal = {x=tpos.x, y=tpos.y-1.5, z=tpos.z} player:set_pos(goal) - minetest.sound_play({name="mcl_end_teleport", gain=0.8}, {pos=goal, max_hear_distance=16}) + minetest.sound_play({name="mcl_end_teleport", gain=0.8}, {pos=goal, max_hear_distance=16}, true) return true end end diff --git a/mods/ITEMS/mcl_farming/hoes.lua b/mods/ITEMS/mcl_farming/hoes.lua index 27d0c316d9..8a6f9527ae 100644 --- a/mods/ITEMS/mcl_farming/hoes.lua +++ b/mods/ITEMS/mcl_farming/hoes.lua @@ -11,14 +11,14 @@ local function create_soil(pos, inv) if above.name == "air" then node.name = "mcl_farming:soil" minetest.set_node(pos, node) - minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.5 }) + minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.5 }, true) return true end elseif minetest.get_item_group(name, "cultivatable") == 1 then if above.name == "air" then node.name = "mcl_core:dirt" minetest.set_node(pos, node) - minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.6 }) + minetest.sound_play("default_dig_crumbly", { pos = pos, gain = 0.6 }, true) return true end end diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index 9844dd437c..0c366af29e 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -84,7 +84,7 @@ function mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname) local place_s = minetest.get_node(pos) if string.find(farmland.name, "mcl_farming:soil") and string.find(place_s.name, "air") then - minetest.sound_play(minetest.registered_nodes[plantname].sounds.place, {pos = pos}) + minetest.sound_play(minetest.registered_nodes[plantname].sounds.place, {pos = pos}, true) minetest.add_node(pos, {name=plantname, param2 = minetest.registered_nodes[plantname].place_param2}) else return diff --git a/mods/ITEMS/mcl_fences/init.lua b/mods/ITEMS/mcl_fences/init.lua index 89b61c629d..5d6654c14d 100644 --- a/mods/ITEMS/mcl_fences/init.lua +++ b/mods/ITEMS/mcl_fences/init.lua @@ -102,11 +102,11 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups, local tmp_node2 if state2 == 1 then state2 = 0 - minetest.sound_play(sound_close, {gain = sound_gain_close, max_hear_distance = 10, pos = pos}) + minetest.sound_play(sound_close, {gain = sound_gain_close, max_hear_distance = 10, pos = pos}, true) tmp_node2 = {name=gate_id, param1=node.param1, param2=node.param2} else state2 = 1 - minetest.sound_play(sound_open, {gain = sound_gain_open, max_hear_distance = 10, pos = pos}) + minetest.sound_play(sound_open, {gain = sound_gain_open, max_hear_distance = 10, pos = pos}, true) tmp_node2 = {name=open_gate_id, param1=node.param1, param2=node.param2} end update_gate(pos, tmp_node2) diff --git a/mods/ITEMS/mcl_fire/flint_and_steel.lua b/mods/ITEMS/mcl_fire/flint_and_steel.lua index bb8c6ce734..d88338402d 100644 --- a/mods/ITEMS/mcl_fire/flint_and_steel.lua +++ b/mods/ITEMS/mcl_fire/flint_and_steel.lua @@ -28,7 +28,8 @@ minetest.register_tool("mcl_fire:flint_and_steel", { local idef = itemstack:get_definition() minetest.sound_play( "fire_flint_and_steel", - {pos = pointed_thing.above, gain = 0.5, max_hear_distance = 8} + {pos = pointed_thing.above, gain = 0.5, max_hear_distance = 8}, + true ) local used = false if pointed_thing.type == "node" then @@ -44,7 +45,7 @@ minetest.register_tool("mcl_fire:flint_and_steel", { used = true end if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then - minetest.sound_play(idef.sound.breaks, {pos=user:get_pos(), gain=0.5}) + minetest.sound_play(idef.sound.breaks, {pos=user:get_pos(), gain=0.5}, true) end if not minetest.settings:get_bool("creative_mode") and used == true then itemstack:add_wear(65535/65) -- 65 uses diff --git a/mods/ITEMS/mcl_fire/init.lua b/mods/ITEMS/mcl_fire/init.lua index ff7b790266..f44c669afd 100644 --- a/mods/ITEMS/mcl_fire/init.lua +++ b/mods/ITEMS/mcl_fire/init.lua @@ -67,7 +67,7 @@ minetest.register_node("mcl_fire:fire", { floodable = true, on_flood = function(pos, oldnode, newnode) if minetest.get_item_group(newnode.name, "water") ~= 0 then - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) end end, on_timer = function(pos) @@ -151,7 +151,7 @@ minetest.register_node("mcl_fire:eternal_fire", { floodable = true, on_flood = function(pos, oldnode, newnode) if minetest.get_item_group(newnode.name, "water") ~= 0 then - minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}) + minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true) end end, on_timer = function(pos) @@ -310,7 +310,7 @@ minetest.register_abm({ action = function(pos, node, active_object_count, active_object_count_wider) minetest.remove_node(pos) minetest.sound_play("fire_extinguish_flame", - {pos = pos, max_hear_distance = 16, gain = 0.15}) + {pos = pos, max_hear_distance = 16, gain = 0.15}, true) end, }) diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 192a8f6efe..e5c4698ca4 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -105,7 +105,7 @@ local fish = function(itemstack, player) local idef = itemstack:get_definition() itemstack:add_wear(65535/65) -- 65 uses if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then - minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}) + minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}, true) end end end @@ -119,7 +119,7 @@ local fish = function(itemstack, player) local idef = itemstack:get_definition() itemstack:add_wear((65535/65)*2) -- if so and not creative then wear double like in MC. if itemstack:get_count() == 0 and idef.sound and idef.sound.breaks then - minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}) + minetest.sound_play(idef.sound.breaks, {pos=player:get_pos(), gain=0.5}, true) end end end diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index fb1ae105ef..2b9aac6b97 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -265,7 +265,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im param2 = get_palette_color_from_pos(bottom) end -- Success! We can now place the flower - minetest.sound_play(minetest.registered_nodes[itemstring].sounds.place, {pos = bottom, gain=1}) + minetest.sound_play(minetest.registered_nodes[itemstring].sounds.place, {pos = bottom, gain=1}, true) minetest.set_node(bottom, {name=itemstring, param2=param2}) minetest.set_node(top, {name=itemstring.."_top", param2=param2}) if not minetest.settings:get_bool("creative_mode") then @@ -420,7 +420,7 @@ minetest.register_node("mcl_flowers:waterlily", { local idef = itemstack:get_definition() if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}, true) end if not minetest.settings:get_bool("creative_mode") then diff --git a/mods/ITEMS/mcl_nether/nether_wart.lua b/mods/ITEMS/mcl_nether/nether_wart.lua index caaf41e553..7744a1fecf 100644 --- a/mods/ITEMS/mcl_nether/nether_wart.lua +++ b/mods/ITEMS/mcl_nether/nether_wart.lua @@ -125,7 +125,7 @@ minetest.register_craftitem("mcl_nether:nether_wart_item", { -- Check if node above soil node allows placement if minetest.registered_items[minetest.get_node(placepos).name].buildable_to then -- Place nether wart - minetest.sound_play({name="default_place_node", gain=1.0}, {pos=placepos}) + minetest.sound_play({name="default_place_node", gain=1.0}, {pos=placepos}, true) minetest.set_node(placepos, {name="mcl_nether:nether_wart_0", param2 = 3}) if not minetest.settings:get_bool("creative_mode") then diff --git a/mods/ITEMS/mcl_ocean/corals.lua b/mods/ITEMS/mcl_ocean/corals.lua index a84dd92081..2a9015ec77 100644 --- a/mods/ITEMS/mcl_ocean/corals.lua +++ b/mods/ITEMS/mcl_ocean/corals.lua @@ -59,7 +59,7 @@ local function coral_on_place(itemstack, placer, pointed_thing) minetest.set_node(pos_under, node_under) local def_node = minetest.registered_nodes[node_under.name] if def_node.sounds then - minetest.sound_play(def_node.sounds.place, { gain = 0.5, pos = pos_under }) + minetest.sound_play(def_node.sounds.place, { gain = 0.5, pos = pos_under }, true) end if not (minetest.settings:get_bool("creative_mode")) then itemstack:take_item() diff --git a/mods/ITEMS/mcl_ocean/kelp.lua b/mods/ITEMS/mcl_ocean/kelp.lua index e329ddcce1..a559697f79 100644 --- a/mods/ITEMS/mcl_ocean/kelp.lua +++ b/mods/ITEMS/mcl_ocean/kelp.lua @@ -120,7 +120,7 @@ local function kelp_on_place(itemstack, placer, pointed_thing) -- Place or grow kelp local def_node = minetest.registered_items[node_under.name] if def_node.sounds then - minetest.sound_play(def_node.sounds.place, { gain = 0.5, pos = pos_under }) + minetest.sound_play(def_node.sounds.place, { gain = 0.5, pos = pos_under }, true) end minetest.set_node(pos_under, node_under) if not (minetest.settings:get_bool("creative_mode")) then diff --git a/mods/ITEMS/mcl_ocean/seagrass.lua b/mods/ITEMS/mcl_ocean/seagrass.lua index 6c0b5f7437..a5765cf930 100644 --- a/mods/ITEMS/mcl_ocean/seagrass.lua +++ b/mods/ITEMS/mcl_ocean/seagrass.lua @@ -67,7 +67,7 @@ local function seagrass_on_place(itemstack, placer, pointed_thing) end local def_node = minetest.registered_items[node_under.name] if def_node.sounds then - minetest.sound_play(def_node.sounds.place, { gain = 0.5, pos = pos_under }) + minetest.sound_play(def_node.sounds.place, { gain = 0.5, pos = pos_under }, true) end minetest.set_node(pos_under, node_under) if not (minetest.settings:get_bool("creative_mode")) then diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index c16c95eb21..c7e8cf8d66 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -293,7 +293,7 @@ minetest.register_abm({ obj:set_look_horizontal(math.pi/2) end mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target)) - minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}) + minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true) end end end @@ -404,7 +404,7 @@ minetest.override_item("mcl_end:ender_eye", { end minetest.sound_play( "default_place_node_hard", - {pos = pointed_thing.under, gain = 0.5, max_hear_distance = 16}) + {pos = pointed_thing.under, gain = 0.5, max_hear_distance = 16}, true) if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() -- 1 use end diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index ab64ff90a5..f58058e6c5 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -447,7 +447,7 @@ minetest.register_abm({ obj:set_pos(target) if obj:is_player() then mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target)) - minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}) + minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true) end -- Enable teleportation cooloff for some seconds, to prevent back-and-forth teleportation diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 73663673d2..5123d8b741 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -108,7 +108,7 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { itemstack:take_item() end end - minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}) + minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) end end return itemstack @@ -188,7 +188,7 @@ minetest.register_craftitem("mcl_potions:potion_water", { end -- Increase water level of cauldron by 1 minetest.set_node(pointed_thing.under, {name=cauldron}) - minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}) + minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) if minetest.settings:get_bool("creative_mode") == true then return itemstack else @@ -234,7 +234,7 @@ minetest.register_craftitem("mcl_potions:potion_river_water", { end -- Increase water level of cauldron by 1 minetest.set_node(pointed_thing.under, {name=cauldron}) - minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}) + minetest.sound_play("mcl_potions_bottle_pour", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) if minetest.settings:get_bool("creative_mode") == true then return itemstack else diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index 3127b53250..442458a919 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -391,7 +391,7 @@ minetest.register_node("mcl_signs:wall_sign", { text_entity:set_yaw(sign_info.yaw) text_entity:get_luaentity()._signnodename = nodeitem:get_name() - minetest.sound_play({name="default_place_node_hard", gain=1.0}, {pos = place_pos}) + minetest.sound_play({name="default_place_node_hard", gain=1.0}, {pos = place_pos}, true) show_formspec(placer, place_pos) return itemstack diff --git a/mods/ITEMS/mcl_throwing/init.lua b/mods/ITEMS/mcl_throwing/init.lua index 9dcbb2f2d3..fb5fcaccfa 100644 --- a/mods/ITEMS/mcl_throwing/init.lua +++ b/mods/ITEMS/mcl_throwing/init.lua @@ -182,14 +182,14 @@ local snowball_on_step = function(self, dtime) -- Destroy when hitting a solid node if self._lastpos.x~=nil then if (def and def.walkable) or not def then - minetest.sound_play("mcl_throwing_snowball_impact_hard", { pos = self.object:get_pos(), max_hear_distance=16, gain=0.7 }) + minetest.sound_play("mcl_throwing_snowball_impact_hard", { pos = self.object:get_pos(), max_hear_distance=16, gain=0.7 }, true) self.object:remove() return end end if check_object_hit(self, pos, {snowball_vulnerable = 3}) then - minetest.sound_play("mcl_throwing_snowball_impact_soft", { pos = self.object:get_pos(), max_hear_distance=16, gain=0.7 }) + minetest.sound_play("mcl_throwing_snowball_impact_soft", { pos = self.object:get_pos(), max_hear_distance=16, gain=0.7 }, true) return end @@ -243,7 +243,7 @@ local egg_on_step = function(self, dtime) end end end - minetest.sound_play("mcl_throwing_egg_impact", { pos = self.object:get_pos(), max_hear_distance=10, gain=0.5 }) + minetest.sound_play("mcl_throwing_egg_impact", { pos = self.object:get_pos(), max_hear_distance=10, gain=0.5 }, true) self.object:remove() return end @@ -251,7 +251,7 @@ local egg_on_step = function(self, dtime) -- Destroy when hitting a mob or player (no chick spawning) if check_object_hit(self, pos) then - minetest.sound_play("mcl_throwing_egg_impact", { pos = self.object:get_pos(), max_hear_distance=10, gain=0.5 }) + minetest.sound_play("mcl_throwing_egg_impact", { pos = self.object:get_pos(), max_hear_distance=10, gain=0.5 }, true) return end diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 42fbb7b5ca..dafb5a84e5 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -4,7 +4,7 @@ local tnt_griefing = minetest.settings:get_bool("mcl_tnt_griefing", true) local mod_death_messages = minetest.get_modpath("mcl_death_messages") local function spawn_tnt(pos, entname) - minetest.sound_play("tnt_ignite", {pos = pos,gain = 1.0,max_hear_distance = 15,}) + minetest.sound_play("tnt_ignite", {pos = pos,gain = 1.0,max_hear_distance = 15,}, true) local tnt = minetest.add_entity(pos, entname) tnt:set_armor_groups({immortal=1}) return tnt @@ -228,7 +228,7 @@ tnt.boom = function(pos, info) if info.is_tnt == nil then info.is_tnt = true end - minetest.sound_play(sound, {pos = pos,gain = 1.0,max_hear_distance = 16,}) + minetest.sound_play(sound, {pos = pos,gain = 1.0,max_hear_distance = 16,}, true) local node = minetest.get_node(pos) if minetest.get_item_group("water") == 1 or minetest.get_item_group("lava") == 1 then -- Cancel the Explosion diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index 31d091c62d..8f476d726a 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -217,7 +217,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing) local wear = math.ceil(65535 / uses) itemstack:add_wear(wear) end - minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}) + minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}, true) minetest.swap_node(pointed_thing.under, {name="mcl_core:grass_path"}) end end @@ -251,7 +251,7 @@ if minetest.get_modpath("mcl_farming") then local wear = math.ceil(65535 / uses) itemstack:add_wear(wear) end - minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}) + minetest.sound_play({name="default_grass_footstep", gain=1}, {pos = above}, true) local dir = vector.subtract(pointed_thing.under, pointed_thing.above) local param2 = minetest.dir_to_facedir(dir) minetest.swap_node(pointed_thing.under, {name="mcl_farming:pumpkin_face", param2 = param2}) diff --git a/mods/ITEMS/mcl_torches/init.lua b/mods/ITEMS/mcl_torches/init.lua index ea7c1a2a2c..86cb917b9c 100644 --- a/mods/ITEMS/mcl_torches/init.lua +++ b/mods/ITEMS/mcl_torches/init.lua @@ -127,7 +127,7 @@ mcl_torches.register_torch = function(substring, description, doc_items_longdesc itemstack:set_name(itemstring) if success and idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=under, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=under, gain=1}, true) end return itemstack end, diff --git a/mods/PLAYER/mcl_hunger/hunger.lua b/mods/PLAYER/mcl_hunger/hunger.lua index eacec1bc5d..a664b6ad8e 100644 --- a/mods/PLAYER/mcl_hunger/hunger.lua +++ b/mods/PLAYER/mcl_hunger/hunger.lua @@ -149,7 +149,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso gain = 1.0, pitch = 1 + math.random(-10, 10)*0.005, object = user, - }) + }, true) else -- Assume the item is a food -- Add eat particle effect and sound @@ -188,7 +188,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso gain = 1.0, pitch = 1 + math.random(-10, 10)*0.005, object = user, - }) + }, true) end if mcl_hunger.active and hunger_change then