maybe fix https://pastebin.com/raw/UUd9Ay31 not tested as it is rare

This commit is contained in:
PhanaticD 2019-01-23 12:58:39 -05:00
parent dfe5035485
commit 038e8ab216

View file

@ -18,6 +18,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Statistic; import org.bukkit.Statistic;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
import java.util.HashMap; import java.util.HashMap;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -30,6 +31,7 @@ public class ProjectKorra extends JavaPlugin {
public static CollisionInitializer collisionInitializer; public static CollisionInitializer collisionInitializer;
public static long time_step = 1; public static long time_step = 1;
public Updater updater; public Updater updater;
private BukkitTask revertChecker;
@Override @Override
public void onEnable() { 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 EarthbendingManager(this), 0, 1);
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new FirebendingManager(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().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")) { if (ConfigManager.languageConfig.get().getBoolean("Chat.Branding.AutoAnnouncer.Enabled")) {
this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
@Override @Override
@ -137,6 +139,7 @@ public class ProjectKorra extends JavaPlugin {
@Override @Override
public void onDisable() { public void onDisable() {
revertChecker.cancel();
GeneralMethods.stopBending(); GeneralMethods.stopBending();
for (final Player player : this.getServer().getOnlinePlayers()) { for (final Player player : this.getServer().getOnlinePlayers()) {
if (isStatisticsEnabled()) { if (isStatisticsEnabled()) {