mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 04:57:27 +00:00
Merge pull request #189 from KAMKEEL/codex/fix-sound-duplication-issue-with-bard-npc
Fix bard sound duplication
This commit is contained in:
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