AutoUpdatedBossBar: don’t throw exception when cancelling twice

This commit is contained in:
Marc Baloup 2023-01-08 00:13:14 +01:00
parent 721175f965
commit df34881771
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

View File

@ -141,7 +141,7 @@ public class AutoUpdatedBossBar implements Listener {
public synchronized void cancel() { public synchronized void cancel() {
if (!scheduled) if (!scheduled)
throw new IllegalStateException("Can't cancel a not scheduled bossbar update"); return;
scheduled = false; scheduled = false;
if (timer != null) { if (timer != null) {
timer.cancel(); timer.cancel();