From 038e8ab216d1c61a30820e8a01899d7f3ab1aaf8 Mon Sep 17 00:00:00 2001 From: PhanaticD Date: Wed, 23 Jan 2019 12:58:39 -0500 Subject: [PATCH] maybe fix https://pastebin.com/raw/UUd9Ay31 not tested as it is rare --- src/com/projectkorra/projectkorra/ProjectKorra.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/projectkorra/projectkorra/ProjectKorra.java b/src/com/projectkorra/projectkorra/ProjectKorra.java index dacaffb1..b8df86d0 100644 --- a/src/com/projectkorra/projectkorra/ProjectKorra.java +++ b/src/com/projectkorra/projectkorra/ProjectKorra.java @@ -18,6 +18,7 @@ import org.bukkit.ChatColor; import org.bukkit.Statistic; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitTask; import java.util.HashMap; import java.util.logging.Logger; @@ -30,6 +31,7 @@ public class ProjectKorra extends JavaPlugin { public static CollisionInitializer collisionInitializer; public static long time_step = 1; public Updater updater; + private BukkitTask revertChecker; @Override public void onEnable() { @@ -65,7 +67,7 @@ public class ProjectKorra extends JavaPlugin { this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new EarthbendingManager(this), 0, 1); this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new FirebendingManager(this), 0, 1); this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new ChiblockingManager(this), 0, 1); - this.getServer().getScheduler().runTaskTimerAsynchronously(this, new RevertChecker(this), 0, 200); + revertChecker = this.getServer().getScheduler().runTaskTimerAsynchronously(this, new RevertChecker(this), 0, 200); if (ConfigManager.languageConfig.get().getBoolean("Chat.Branding.AutoAnnouncer.Enabled")) { this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { @Override @@ -137,6 +139,7 @@ public class ProjectKorra extends JavaPlugin { @Override public void onDisable() { + revertChecker.cancel(); GeneralMethods.stopBending(); for (final Player player : this.getServer().getOnlinePlayers()) { if (isStatisticsEnabled()) {