make bossbars show that it is not active when disabled

This commit is contained in:
Chayapak 2023-10-16 15:03:59 +07:00
parent d43ef39b08
commit 6a7c0d69fd
2 changed files with 11 additions and 0 deletions

View file

@ -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()) {

View file

@ -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);
}