mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-21 06:43:17 -04:00
Merge d49a0de858
into d546a5a1fa
This commit is contained in:
commit
e1ab90a82a
12 changed files with 93 additions and 0 deletions
|
@ -189,3 +189,17 @@ Mito551 (sounds) (CC BY-SA):
|
|||
default_dirt_footstep.1.ogg
|
||||
default_dirt_footstep.2.ogg
|
||||
default_glass_footstep.ogg
|
||||
|
||||
earthcalling (sounds) (CC0):
|
||||
default_flow_water.ogg
|
||||
default_flow_lava.ogg
|
||||
|
||||
LeonMire (sounds) (CC0):
|
||||
default_use_chest.ogg
|
||||
|
||||
Stephan (sounds) (CC0):
|
||||
default_use_furnace.ogg
|
||||
default_eat.ogg
|
||||
|
||||
Thore (sounds) (CC0):
|
||||
default_use_workbench.ogg
|
|
@ -83,6 +83,78 @@ function default.node_sound_glass_defaults(table)
|
|||
return table
|
||||
end
|
||||
|
||||
--
|
||||
-- Fluid flow sounds
|
||||
--
|
||||
|
||||
local flow_sounds = {}
|
||||
|
||||
local function flow_sound_start(pos, file)
|
||||
local pos_hash = minetest.hash_node_position(pos)
|
||||
local sound = flow_sounds[pos_hash]
|
||||
|
||||
if not sound then
|
||||
-- Abort if this touches another liquid source, or lakes can cause heavy sound spam
|
||||
local positions = {}
|
||||
table.insert(positions, {x = pos.x - 1, y = pos.y, z = pos.z})
|
||||
table.insert(positions, {x = pos.x + 1, y = pos.y, z = pos.z})
|
||||
table.insert(positions, {x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
table.insert(positions, {x = pos.x, y = pos.y + 1, z = pos.z})
|
||||
table.insert(positions, {x = pos.x, y = pos.y, z = pos.z - 1})
|
||||
table.insert(positions, {x = pos.x, y = pos.y, z = pos.z + 1})
|
||||
for i, entry in ipairs(positions) do
|
||||
local pos_here = { x = entry.x, y = entry.y, z = entry.z }
|
||||
local node_here = minetest.get_node(pos_here)
|
||||
local nodedef_here = minetest.registered_nodes[node_here.name]
|
||||
if(nodedef_here.drawtype == "liquid") then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
flow_sounds[pos_hash] = {
|
||||
handle = minetest.sound_play(file, {pos = pos, gain = 0.5, loop = true}),
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local function flow_sound_stop(pos)
|
||||
local pos_hash = minetest.hash_node_position(pos)
|
||||
local sound = flow_sounds[pos_hash]
|
||||
|
||||
if sound then
|
||||
minetest.sound_stop(sound.handle)
|
||||
flow_sounds[pos_hash] = nil
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode(function(pos, _, _, _, _)
|
||||
flow_sound_stop(pos)
|
||||
end)
|
||||
|
||||
minetest.register_on_dignode(function(pos, _, _)
|
||||
flow_sound_stop(pos)
|
||||
end)
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:water_source"},
|
||||
neighbors = {"default:water_flowing"},
|
||||
interval = 0.5,
|
||||
chance = 1,
|
||||
action = function(pos, node, _, _)
|
||||
flow_sound_start(pos, "default_flow_water")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:lava_source"},
|
||||
neighbors = {"default:lava_flowing"},
|
||||
interval = 0.5,
|
||||
chance = 1,
|
||||
action = function(pos, node, _, _)
|
||||
flow_sound_start(pos, "default_flow_lava")
|
||||
end,
|
||||
})
|
||||
|
||||
--
|
||||
-- Legacy
|
||||
--
|
||||
|
|
BIN
mods/default/sounds/default_eat.ogg
Normal file
BIN
mods/default/sounds/default_eat.ogg
Normal file
Binary file not shown.
BIN
mods/default/sounds/default_flow_lava.ogg
Normal file
BIN
mods/default/sounds/default_flow_lava.ogg
Normal file
Binary file not shown.
BIN
mods/default/sounds/default_flow_water.ogg
Normal file
BIN
mods/default/sounds/default_flow_water.ogg
Normal file
Binary file not shown.
BIN
mods/default/sounds/default_use_chest.ogg
Normal file
BIN
mods/default/sounds/default_use_chest.ogg
Normal file
Binary file not shown.
BIN
mods/default/sounds/default_use_furnace.ogg
Normal file
BIN
mods/default/sounds/default_use_furnace.ogg
Normal file
Binary file not shown.
BIN
mods/default/sounds/default_use_workbench.ogg
Normal file
BIN
mods/default/sounds/default_use_workbench.ogg
Normal file
Binary file not shown.
|
@ -35,6 +35,13 @@ following Textures created by PenguinDad (CC BY-SA 4.0):
|
|||
door_glass.png
|
||||
door_obsidian_glass.png
|
||||
|
||||
Door sounds created by Slanesh (CC-BY 3.0):
|
||||
doors_door_open.ogg
|
||||
doors_door_close.ogg
|
||||
|
||||
Gate sound created by j1987 (CC0):
|
||||
doors_gate_open_close.ogg
|
||||
|
||||
All other textures (created by PilzAdam): WTFPL
|
||||
|
||||
|
||||
|
|
BIN
mods/doors/sounds/doors_door_close.ogg
Normal file
BIN
mods/doors/sounds/doors_door_close.ogg
Normal file
Binary file not shown.
BIN
mods/doors/sounds/doors_door_open.ogg
Normal file
BIN
mods/doors/sounds/doors_door_open.ogg
Normal file
Binary file not shown.
BIN
mods/doors/sounds/doors_gate_open_close.ogg
Normal file
BIN
mods/doors/sounds/doors_gate_open_close.ogg
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue