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

View file

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

View file

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

View file

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