make bossbars show that it is not active when disabled
This commit is contained in:
parent
d43ef39b08
commit
6a7c0d69fd
2 changed files with 11 additions and 0 deletions
|
@ -288,6 +288,10 @@ public class MusicPlayerPlugin extends Bot.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeBossBar() {
|
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);
|
bot.bossbar.remove(bossbarName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,6 +376,8 @@ public class MusicPlayerPlugin extends Bot.Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handlePlaying () {
|
public void handlePlaying () {
|
||||||
|
if (currentSong == null) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
currentSong.advanceTime();
|
currentSong.advanceTime();
|
||||||
while (currentSong.reachedNextNote()) {
|
while (currentSong.reachedNextNote()) {
|
||||||
|
|
|
@ -66,6 +66,11 @@ public class TPSPlugin extends Bot.Listener {
|
||||||
|
|
||||||
public void off () {
|
public void off () {
|
||||||
enabled = false;
|
enabled = false;
|
||||||
|
|
||||||
|
final BotBossBar bossBar = bot.bossbar.get(bossbarName);
|
||||||
|
|
||||||
|
if (bossBar != null) bossBar.setTitle(Component.text("TPSBar is currently disabled"));
|
||||||
|
|
||||||
bot.bossbar.remove(bossbarName);
|
bot.bossbar.remove(bossbarName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue