mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-12 03:57:03 +00:00
Change updater from 30 seconds to 30 minutes
This commit is contained in:
parent
f84ced34f6
commit
ca17028aef
1 changed files with 4 additions and 4 deletions
|
@ -314,8 +314,6 @@ public class DisguiseConfig {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int timer = (int) (TimeUnit.HOURS.toSeconds(isHittingRateLimit() ? 36 : 6) * 20);
|
|
||||||
|
|
||||||
if (!LibsDisguises.getInstance().getConfig().getDefaults().getBoolean("AutoUpdate")) {
|
if (!LibsDisguises.getInstance().getConfig().getDefaults().getBoolean("AutoUpdate")) {
|
||||||
updaterTask = Bukkit.getScheduler().runTaskTimer(LibsDisguises.getInstance(), new Runnable() {
|
updaterTask = Bukkit.getScheduler().runTaskTimer(LibsDisguises.getInstance(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -342,11 +340,13 @@ public class DisguiseConfig {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int timer = (int) (TimeUnit.HOURS.toSeconds(isHittingRateLimit() ? 36 : 6) * 20);
|
||||||
|
|
||||||
// Get the ticks since last update
|
// Get the ticks since last update
|
||||||
long timeSinceLast = (System.currentTimeMillis() - getLastUpdateRequest()) / 50;
|
long timeSinceLast = (System.currentTimeMillis() - getLastUpdateRequest()) / 50;
|
||||||
|
|
||||||
// Next update check will be in 30 seconds, or the timer - elapsed time. Whatever is greater
|
// Next update check will be in 30 minutes, or the timer - elapsed time. Whatever is greater
|
||||||
timeSinceLast = Math.max(30 * 20, timer - timeSinceLast);
|
timeSinceLast = Math.max(30 * 60 * 20, timer - timeSinceLast);
|
||||||
|
|
||||||
updaterTask = Bukkit.getScheduler().runTaskTimerAsynchronously(LibsDisguises.getInstance(), new Runnable() {
|
updaterTask = Bukkit.getScheduler().runTaskTimerAsynchronously(LibsDisguises.getInstance(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue