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 a362f29..b8abce4 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 @@ -288,6 +288,10 @@ public class MusicPlayerPlugin extends Bot.Listener { } public void removeBossBar() { + final BotBossBar bossBar = bot.bossbar.get(bossbarName); + + if (bossBar != null) bossBar.setTitle(Component.text("No song is currently playing")); + bot.bossbar.remove(bossbarName); } @@ -372,6 +376,8 @@ public class MusicPlayerPlugin extends Bot.Listener { } public void handlePlaying () { + if (currentSong == null) return; + try { currentSong.advanceTime(); while (currentSong.reachedNextNote()) { diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java index bd4b1f0..b0577f4 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/TPSPlugin.java @@ -66,6 +66,11 @@ public class TPSPlugin extends Bot.Listener { public void off () { enabled = false; + + final BotBossBar bossBar = bot.bossbar.get(bossbarName); + + if (bossBar != null) bossBar.setTitle(Component.text("TPSBar is currently disabled")); + bot.bossbar.remove(bossbarName); }