mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 01:57:34 +00:00
fix: prevent bard song duplication
This commit is contained in:
1 parent
91dc56bf87
commit
297b19b2e5
1 file changed
+11
-5
@@ -56,16 +56,22 @@ public class MusicController {
|
||||
|
||||
public void stopMusic() {
|
||||
SoundHandler soundHandler = Minecraft.getMinecraft().getSoundHandler();
|
||||
if (soundHandler != null) {
|
||||
if (this.playingSound != null) {
|
||||
if (soundHandler != null) {
|
||||
try {
|
||||
soundHandler.stopSound(this.playingSound);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
this.playingSound.stopSound();
|
||||
this.sounds.remove(this.playingSound.sound);
|
||||
this.playingSound = null;
|
||||
} else if (soundHandler != null) {
|
||||
try {
|
||||
soundHandler.stopSounds();
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
if (this.playingSound != null) {
|
||||
this.playingSound.stopSound();
|
||||
this.playingSound = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void playMusicJukebox(String music, Entity entity, int offRange) {
|
||||
|
||||
Reference in new issue
Block a user