From 0d5320aca84f4a3110d172b1aec21edd6f394311 Mon Sep 17 00:00:00 2001 From: Taylor Becker Date: Sun, 6 Mar 2016 02:58:30 +0000 Subject: [PATCH] Made boss bar tasks async --- .../simplemc/simpleannounce/message/sender/BossBarSender.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/simplemc/simpleannounce/message/sender/BossBarSender.java b/src/main/java/org/simplemc/simpleannounce/message/sender/BossBarSender.java index c97e015..9f3f8a9 100755 --- a/src/main/java/org/simplemc/simpleannounce/message/sender/BossBarSender.java +++ b/src/main/java/org/simplemc/simpleannounce/message/sender/BossBarSender.java @@ -67,7 +67,7 @@ public void run() final BukkitTask animationTask; if (animate) { - animationTask = Bukkit.getScheduler().runTaskTimer(plugin, () -> + animationTask = Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, () -> bossBar.setProgress(bossBar.getProgress() + ((reverse ? -1 : 1) * (1.0 / holdTime))) , 0, 1L); } @@ -78,7 +78,7 @@ public void run() // schedule boss bar to go away Runnable hideBossBar = message instanceof RepeatingMessage ? bossBar::hide : bossBar::removeAll; - Bukkit.getScheduler().runTaskLater(plugin, () -> + Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, () -> { // reset progress bossBar.setProgress(reverse ? 1 : 0);