Merge pull request 'Adding new Exhale & Tim Unwin tracks!' (#3511) from add_new_tracks into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3511
Reviewed-by: Nicu <kneekoo@noreply.git.minetest.land>
This commit is contained in:
ancientmarinerdev 2023-03-07 16:08:26 +00:00
commit 6e6aa83fd8
4 changed files with 7 additions and 4 deletions

@ -205,3 +205,4 @@
* Notch and Jeb for being the major forces behind Minecraft
* Dark Reaven Music (https://soundcloud.com/dark-reaven-music) for the main menu theme (Calmed Cube), which is licensed under https://creativecommons.org/licenses/by-sa/3.0/
* Jester for helping to finely tune MineClone2 (https://www.youtube.com/@Jester-8-bit). Songs: Hailing Forest, Gift, 0dd BL0ck, Flock of One (License CC BY-SA 4.0)
* Exhale & Tim Unwin for some new wonderful MineClone2 tracks (https://www.youtube.com/channel/UClFo_JDWoG4NGrPQY0JPD_g). Songs: Valley of Ghosts, Lonely Blossom (License CC BY-SA 4.0)

@ -10,10 +10,12 @@ local odd_block = "Jester-0dd-BL0ck"
local flock_of_one = "Jester-Flock-of-One"
local gift = "Jester-Gift"
local hailing_forest = "Jester-Hailing_Forest"
local lonely_blossom = "exhale_and_tim_unwin-lonely_blossom"
local valley_of_ghosts = "exhale_and_tim_unwin-valley_of_ghosts"
local dimension_to_base_track = {
["overworld"] = {pianowtune, flock_of_one, gift, hailing_forest},
["nether"] = {nether_tune},
["overworld"] = {pianowtune, flock_of_one, gift, hailing_forest, lonely_blossom},
["nether"] = {nether_tune, valley_of_ghosts},
["end"] = {end_tune},
["mining"] = {odd_block},
}
@ -58,6 +60,7 @@ local function stop_music_for_listener_name(listener_name)
local handle = listener.handle
if not handle then return end
minetest.log("action", "[mcl_music] Stopping music")
minetest.sound_stop(handle)
listeners[listener_name].handle = nil
end
@ -130,7 +133,6 @@ local function play()
--minetest.log("handle: " .. dump (handle))
if is_hp_changed or is_dimension_changed or underground_changed
or (dimension == "overworld" and (is_weather_changed or not is_good_weather)) then
minetest.log("action", "[mcl_music] Stopping music")
stop_music_for_listener_name(player_name)
if not listeners[player_name] then
listeners[player_name] = {}