Convert minetest.sound_play uses to ephemeral

This commit is contained in:
sfan5
2020-01-25 23:45:09 +01:00
parent 176ddba176
commit d3e26dba18
9 changed files with 28 additions and 22 deletions

View File

@ -59,7 +59,7 @@ farming.hoe_on_use = function(itemstack, user, pointed_thing, uses)
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
})
}, true)
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(user:get_player_name())) then
@ -68,7 +68,8 @@ farming.hoe_on_use = function(itemstack, user, pointed_thing, uses)
itemstack:add_wear(65535/(uses-1))
-- tool break sound
if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then
minetest.sound_play(wdef.sound.breaks, {pos = pt.above, gain = 0.5})
minetest.sound_play(wdef.sound.breaks, {pos = pt.above,
gain = 0.5}, true)
end
end
return itemstack