diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java index 3a7481e..6681a1b 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/MusicPlayerPlugin.java @@ -142,8 +142,8 @@ public class MusicPlayerPlugin extends Bot.Listener { if (bot.bossbar.enabled && bot.options.useCore) { bossBar.setTitle(generateBossbar()); bossBar.setColor(bossBarColor); - bossBar.setValue((int) Math.floor(((double) currentSong.time / 1000) * speed)); - bossBar.setMax((long) ((currentSong.length / 1000) * speed)); + bossBar.setValue((int) Math.floor(((double) (currentSong.time * speed) / 1000))); + bossBar.setMax((long) (currentSong.length * speed) / 1000); } if (currentSong.paused || bot.core.isRateLimited()) return; @@ -250,7 +250,7 @@ public class MusicPlayerPlugin extends Bot.Listener { Component .translatable("%s / %s", formatTime((long) (currentSong.time * speed)).color(NamedTextColor.GRAY), - formatTime(currentSong.length).color(NamedTextColor.GRAY)).color(NamedTextColor.DARK_GRAY) + formatTime((long) (currentSong.length * speed)).color(NamedTextColor.GRAY)).color(NamedTextColor.DARK_GRAY) ); if (!bot.core.hasRateLimit()) { diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java index 65891ea..f1e4f81 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/song/Song.java @@ -150,7 +150,7 @@ public class Song { } public boolean finished () { - return time > length || position >= size(); + return (time * bot.music.speed) > length || position >= size(); } public int size () {