diff --git a/patches/net/minecraft/server/MinecraftServer.java.patch b/patches/net/minecraft/server/MinecraftServer.java.patch index 5c3d4817..a9e969c0 100644 --- a/patches/net/minecraft/server/MinecraftServer.java.patch +++ b/patches/net/minecraft/server/MinecraftServer.java.patch @@ -82,7 +82,7 @@ + if (i > 2000L && this.serverTime - this.timeOfLastWarning >= 15000L) { + long j = (long)(i / TickSpeed.mspt);//50L; + LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); -+ this.serverTime += j * TickSpeed.mspt;//50L; ++ this.serverTime += (long)(j * TickSpeed.mspt);//50L; + this.timeOfLastWarning = this.serverTime; + } @@ -95,7 +95,7 @@ + // only corrected if it falls behind more than 2000 and manages to catch the warning + // which releases accrued time it falls behind, not 1 tick, but MULTIPLE ticks + this.actualServerTime = Util.milliTime(); -+ this.serverTime += TickSpeed.mspt;//50L; ++ this.serverTime += (long)TickSpeed.mspt;//50L; - this.serverIsRunning = true; + while (this.isAheadOfTime()) { diff --git a/src/main/java/carpet/helpers/TickSpeed.java b/src/main/java/carpet/helpers/TickSpeed.java index 9f793c43..27c45c46 100644 --- a/src/main/java/carpet/helpers/TickSpeed.java +++ b/src/main/java/carpet/helpers/TickSpeed.java @@ -58,7 +58,7 @@ public static void add_ticks_to_run_in_pause(int ticks) public static void tickrate(float rate, boolean update) { tickrate = rate; - long mspt = (long)(1000.0 / tickrate); + long mspt = (long)(1000.0f / tickrate); if (mspt <= 0L) { mspt = 1L;