summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaliy <numzer0@yandex.ru>2020-08-01 16:10:14 +0300
committerGitHub <noreply@github.com>2020-08-01 16:10:14 +0300
commitc1eccba24760e0b80666dd8d1e56b5fe7f3a5b28 (patch)
tree0a7fc2ae51665f0f3e7601534d0b980710b0188f
parent01332a7ba11f10e59f42ee40203e231c31ad0079 (diff)
downloadmesecons-c1eccba24760e0b80666dd8d1e56b5fe7f3a5b28.tar
mesecons-c1eccba24760e0b80666dd8d1e56b5fe7f3a5b28.tar.gz
mesecons-c1eccba24760e0b80666dd8d1e56b5fe7f3a5b28.tar.bz2
mesecons-c1eccba24760e0b80666dd8d1e56b5fe7f3a5b28.tar.xz
mesecons-c1eccba24760e0b80666dd8d1e56b5fe7f3a5b28.zip
Make sounds ephemeral (#521)
The handles were never used anyway
-rw-r--r--mesecons_button/init.lua4
-rw-r--r--mesecons_doors/init.lua8
-rw-r--r--mesecons_fpga/tool.lua8
-rw-r--r--mesecons_movestones/init.lua2
-rw-r--r--mesecons_noteblock/init.lua2
-rw-r--r--mesecons_pistons/init.lua12
-rw-r--r--mesecons_switch/init.lua2
-rw-r--r--mesecons_walllever/init.lua2
8 files changed, 16 insertions, 24 deletions
diff --git a/mesecons_button/init.lua b/mesecons_button/init.lua
index 8764fbc..d7b84b6 100644
--- a/mesecons_button/init.lua
+++ b/mesecons_button/init.lua
@@ -8,7 +8,7 @@ mesecon.button_turnoff = function (pos)
return
end
minetest.swap_node(pos, {name = "mesecons_button:button_off", param2 = node.param2})
- minetest.sound_play("mesecons_button_pop", {pos = pos})
+ minetest.sound_play("mesecons_button_pop", { pos = pos }, true)
local rules = mesecon.rules.buttonlike_get(node)
mesecon.receptor_off(pos, rules)
end
@@ -46,7 +46,7 @@ minetest.register_node("mesecons_button:button_off", {
on_rightclick = function (pos, node)
minetest.swap_node(pos, {name = "mesecons_button:button_on", param2=node.param2})
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
- minetest.sound_play("mesecons_button_push", {pos=pos})
+ minetest.sound_play("mesecons_button_push", { pos = pos }, true)
minetest.get_node_timer(pos):start(1)
end,
sounds = default.node_sound_stone_defaults(),
diff --git a/mesecons_doors/init.lua b/mesecons_doors/init.lua
index 52d6c17..cf6faeb 100644
--- a/mesecons_doors/init.lua
+++ b/mesecons_doors/init.lua
@@ -13,9 +13,9 @@ local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
minetest.swap_node(pos, {name = replace, param2 = p2})
if (minetest.get_meta(pos):get_int("right") ~= 0) == (params[1] ~= 3) then
- minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
+ minetest.sound_play("doors_door_close", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
else
- minetest.sound_play("doors_door_open", {pos = pos, gain = 0.3, max_hear_distance = 10})
+ minetest.sound_play("doors_door_open", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
end
end
@@ -79,10 +79,10 @@ local function trapdoor_switch(pos, node)
local state = minetest.get_meta(pos):get_int("state")
if state == 1 then
- minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
+ minetest.sound_play("doors_door_close", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
minetest.set_node(pos, {name="doors:trapdoor", param2 = node.param2})
else
- minetest.sound_play("doors_door_open", {pos = pos, gain = 0.3, max_hear_distance = 10})
+ minetest.sound_play("doors_door_open", { pos = pos, gain = 0.3, max_hear_distance = 10 }, true)
minetest.set_node(pos, {name="doors:trapdoor_open", param2 = node.param2})
end
diff --git a/mesecons_fpga/tool.lua b/mesecons_fpga/tool.lua
index 9e57bde..73d6c0f 100644
--- a/mesecons_fpga/tool.lua
+++ b/mesecons_fpga/tool.lua
@@ -18,12 +18,12 @@ minetest.register_tool("mesecons_fpga:programmer", {
local meta = minetest.get_meta(pos)
if meta:get_string("instr") == "//////////////" then
minetest.chat_send_player(placer:get_player_name(), "This FPGA is unprogrammed.")
- minetest.sound_play("mesecons_fpga_fail", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 })
+ minetest.sound_play("mesecons_fpga_fail", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
return itemstack
end
itemstack:set_metadata(meta:get_string("instr"))
minetest.chat_send_player(placer:get_player_name(), "FPGA gate configuration was successfully copied!")
- minetest.sound_play("mesecons_fpga_copy", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 })
+ minetest.sound_play("mesecons_fpga_copy", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
return itemstack
end,
@@ -45,7 +45,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
local imeta = itemstack:get_metadata()
if imeta == "" then
minetest.chat_send_player(player_name, "Use shift+right-click to copy a gate configuration first.")
- minetest.sound_play("mesecons_fpga_fail", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 })
+ minetest.sound_play("mesecons_fpga_fail", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
return itemstack
end
@@ -53,7 +53,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
meta:set_string("instr", imeta)
plg.update_meta(pos, imeta)
minetest.chat_send_player(player_name, "Gate configuration was successfully written to FPGA!")
- minetest.sound_play("mesecons_fpga_write", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 })
+ minetest.sound_play("mesecons_fpga_write", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
return itemstack
end
diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua
index cc2d942..b7fb8f1 100644
--- a/mesecons_movestones/init.lua
+++ b/mesecons_movestones/init.lua
@@ -66,7 +66,7 @@ function mesecon.register_movestone(name, def, is_sticky, is_vertical)
mesecon.on_dignode(pos, node)
mesecon.on_placenode(frontpos, node)
minetest.get_node_timer(frontpos):start(timer_interval)
- minetest.sound_play("movestone", {pos = pos, max_hear_distance = 20, gain = 0.5,})
+ minetest.sound_play("movestone", { pos = pos, max_hear_distance = 20, gain = 0.5 }, true)
-- ### Step 3: If sticky, pull stack behind ###
if is_sticky then
diff --git a/mesecons_noteblock/init.lua b/mesecons_noteblock/init.lua
index 22755ef..55a9bd7 100644
--- a/mesecons_noteblock/init.lua
+++ b/mesecons_noteblock/init.lua
@@ -67,5 +67,5 @@ mesecon.noteblock_play = function(pos, param2)
end
end
pos.y = pos.y+1
- minetest.sound_play(soundname, {pos = pos})
+ minetest.sound_play(soundname, { pos = pos }, true)
end
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua
index 1af80c5..66c74b2 100644
--- a/mesecons_pistons/init.lua
+++ b/mesecons_pistons/init.lua
@@ -67,11 +67,7 @@ local function piston_remove_pusher(pos, node, check_falling)
end
minetest.remove_node(pusherpos)
- minetest.sound_play("piston_retract", {
- pos = pos,
- max_hear_distance = 20,
- gain = 0.3,
- })
+ minetest.sound_play("piston_retract", { pos = pos, max_hear_distance = 20, gain = 0.3 }, true)
if check_falling then
minetest.check_for_falling(pusherpos)
@@ -96,11 +92,7 @@ local piston_on = function(pos, node)
end
minetest.swap_node(pos, {param2 = node.param2, name = pistonspec.onname})
minetest.set_node(pusher_pos, {param2 = node.param2, name = pistonspec.pusher})
- minetest.sound_play("piston_extend", {
- pos = pos,
- max_hear_distance = 20,
- gain = 0.3,
- })
+ minetest.sound_play("piston_extend", { pos = pos, max_hear_distance = 20, gain = 0.3 }, true)
mesecon.mvps_process_stack(stack)
mesecon.mvps_move_objects(pusher_pos, dir, oldstack)
end
diff --git a/mesecons_switch/init.lua b/mesecons_switch/init.lua
index 7f42253..ba766d4 100644
--- a/mesecons_switch/init.lua
+++ b/mesecons_switch/init.lua
@@ -11,7 +11,7 @@ mesecon.register_node("mesecons_switch:mesecon_switch", {
else
mesecon.receptor_off(pos)
end
- minetest.sound_play("mesecons_switch", {pos=pos})
+ minetest.sound_play("mesecons_switch", { pos = pos }, true)
end
},{
groups = {dig_immediate=2},
diff --git a/mesecons_walllever/init.lua b/mesecons_walllever/init.lua
index 1dc08f0..64d9b28 100644
--- a/mesecons_walllever/init.lua
+++ b/mesecons_walllever/init.lua
@@ -22,7 +22,7 @@ mesecon.register_node("mesecons_walllever:wall_lever", {
else
mesecon.receptor_off(pos, mesecon.rules.buttonlike_get(node))
end
- minetest.sound_play("mesecons_lever", {pos=pos})
+ minetest.sound_play("mesecons_lever", { pos = pos }, true)
end
},{
tiles = {