From ca17028aef99c913d1100a406470a4224174f40a Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 12 Nov 2020 11:04:52 +1300 Subject: [PATCH] Change updater from 30 seconds to 30 minutes --- .../java/me/libraryaddict/disguise/DisguiseConfig.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index 29001c8c..cb361850 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -314,8 +314,6 @@ public class DisguiseConfig { return; } - int timer = (int) (TimeUnit.HOURS.toSeconds(isHittingRateLimit() ? 36 : 6) * 20); - if (!LibsDisguises.getInstance().getConfig().getDefaults().getBoolean("AutoUpdate")) { updaterTask = Bukkit.getScheduler().runTaskTimer(LibsDisguises.getInstance(), new Runnable() { @Override @@ -342,11 +340,13 @@ public class DisguiseConfig { return; } + int timer = (int) (TimeUnit.HOURS.toSeconds(isHittingRateLimit() ? 36 : 6) * 20); + // Get the ticks since last update long timeSinceLast = (System.currentTimeMillis() - getLastUpdateRequest()) / 50; - // Next update check will be in 30 seconds, or the timer - elapsed time. Whatever is greater - timeSinceLast = Math.max(30 * 20, timer - timeSinceLast); + // Next update check will be in 30 minutes, or the timer - elapsed time. Whatever is greater + timeSinceLast = Math.max(30 * 60 * 20, timer - timeSinceLast); updaterTask = Bukkit.getScheduler().runTaskTimerAsynchronously(LibsDisguises.getInstance(), new Runnable() { @Override