Use ephemeral sounds

This commit is contained in:
Wuzzy 2020-04-07 00:55:45 +02:00
parent b2c75acd68
commit c5e4ec5e27
61 changed files with 123 additions and 122 deletions

@ -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)

@ -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

@ -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,
})

@ -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)

@ -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()

@ -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

@ -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)

@ -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,

@ -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

@ -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,

@ -86,7 +86,7 @@ mobs:register_mob("mobs_mc:chicken", {
pos = pos,
gain = 1.0,
max_hear_distance = 16,
})
}, true)
end,
})

@ -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")

@ -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)

@ -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},

@ -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

@ -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

@ -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

@ -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"

@ -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

@ -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,
}

@ -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)

@ -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,

@ -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.")

@ -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

@ -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,

@ -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

@ -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},

@ -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 = {

@ -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

@ -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

@ -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,

@ -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

@ -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

@ -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

@ -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()

@ -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,

@ -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

@ -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

@ -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)

@ -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)

@ -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

@ -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

@ -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

@ -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)

@ -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

@ -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,
})

@ -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

@ -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

@ -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

@ -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()

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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})

@ -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,

@ -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