From 61c7a51818510a800f480db776573b4731ebfffc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 11 Jan 2017 22:52:34 +0100 Subject: [PATCH] Stop music after digging jukebox --- mods/mcl_jukebox/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/mcl_jukebox/init.lua b/mods/mcl_jukebox/init.lua index 7971b9276c..7a38f1735c 100644 --- a/mods/mcl_jukebox/init.lua +++ b/mods/mcl_jukebox/init.lua @@ -128,6 +128,11 @@ minetest.register_node("mcl_jukebox:jukebox", { end end, after_dig_node = function(pos, oldnode, oldmetadata, digger) + local name = digger:get_player_name() + if active_tracks[name] ~= nil then + minetest.sound_stop(active_tracks[name]) + digger:hud_remove(active_huds[name]) + end local meta = minetest.get_meta(pos) local meta2 = meta meta:from_table(oldmetadata)