From 6d45cecbf2a48118b4e8cabf75dd6aafe4d3e10f Mon Sep 17 00:00:00 2001 From: thatsIch Date: Tue, 4 Nov 2014 00:44:50 +0100 Subject: [PATCH] Finalize version checker delay --- src/main/java/appeng/services/VersionChecker.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/appeng/services/VersionChecker.java b/src/main/java/appeng/services/VersionChecker.java index 496ab3ee..36cdbf16 100644 --- a/src/main/java/appeng/services/VersionChecker.java +++ b/src/main/java/appeng/services/VersionChecker.java @@ -20,14 +20,15 @@ import cpw.mods.fml.common.event.FMLInterModComms; public class VersionChecker implements Runnable { - private long delay = 0; + private final long delay; public VersionChecker() { - long now = (new Date()).getTime(); - delay = (1000 * 3600 * 5) - (now - AEConfig.instance.latestTimeStamp); - if ( delay < 1 ) - delay = 1; + final int fiveHours = 1000 * 3600 * 5; + final long now = new Date().getTime(); + final long timeDiff = now - AEConfig.instance.latestTimeStamp; + + this.delay = Math.max( 1, fiveHours - timeDiff); } @Override