From 028bd29065d392060c299f0012c094964ea77926 Mon Sep 17 00:00:00 2001 From: FirstMegaGame4 <84094287+FirstMegaGame4@users.noreply.github.com> Date: Thu, 26 Dec 2024 21:37:00 +0100 Subject: [PATCH] Fix ClientSoundtrackPlayer --- .../soundtracks/client/ClientSoundtrackPlayer.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/mmodding/mmodding_lib/library/soundtracks/client/ClientSoundtrackPlayer.java b/src/main/java/com/mmodding/mmodding_lib/library/soundtracks/client/ClientSoundtrackPlayer.java index 05710c6..53e3025 100644 --- a/src/main/java/com/mmodding/mmodding_lib/library/soundtracks/client/ClientSoundtrackPlayer.java +++ b/src/main/java/com/mmodding/mmodding_lib/library/soundtracks/client/ClientSoundtrackPlayer.java @@ -50,6 +50,9 @@ public void skip() { if (this.currentPart == this.currentSoundtrack.getPartsCount() - 1) { this.stop(); } + else { + this.play(this.currentSoundtrack, this.currentPart + 1); + } } } @@ -89,7 +92,12 @@ public void tick() { } else { if (!this.soundManager.isPlaying(this.instance)) { - this.skip(); + if (this.currentSoundtrack.getPart(this.currentPart).isLooping()) { + this.play(this.currentSoundtrack, this.currentPart); + } + else { + this.skip(); + } } } }