just dont do anything with the update checker on shutdown

This commit is contained in:
Pyrbu 2024-02-16 16:23:11 +01:00
parent abfdc1901b
commit c3a83b6d04
2 changed files with 1 additions and 8 deletions

@ -148,10 +148,7 @@ public class ZNpcsPlus {
log(ChatColor.WHITE + " * Starting tasks..."); log(ChatColor.WHITE + " * Starting tasks...");
if (configManager.getConfig().checkForUpdates()) { if (configManager.getConfig().checkForUpdates()) {
UpdateChecker updateChecker = new UpdateChecker(getDescription()); UpdateChecker updateChecker = new UpdateChecker(getDescription());
scheduler.runLaterAsync(() -> { scheduler.runDelayedTimerAsync(updateChecker, 5L, 6000L);
scheduler.runDelayedTimerAsync(updateChecker, 0L, 6000L);
shutdownTasks.add(updateChecker::shutdown);
}, 5L);
pluginManager.registerEvents(new UpdateNotificationListener(this, adventure, updateChecker, scheduler), bootstrap); pluginManager.registerEvents(new UpdateNotificationListener(this, adventure, updateChecker, scheduler), bootstrap);
} }

@ -40,10 +40,6 @@ public class UpdateChecker extends BukkitRunnable {
logger.warning("Download it at " + UpdateChecker.DOWNLOAD_LINK); logger.warning("Download it at " + UpdateChecker.DOWNLOAD_LINK);
} }
public void shutdown() {
cancel();
}
private int versionToNumber(String version) { private int versionToNumber(String version) {
int num = Integer.parseInt(version.replaceAll("[^0-9]", "")); int num = Integer.parseInt(version.replaceAll("[^0-9]", ""));
if (version.toLowerCase().contains("snapshot")) num -= 1; if (version.toLowerCase().contains("snapshot")) num -= 1;