Skip to content

Commit

Permalink
more type restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Nov 1, 2020
1 parent aeb10b4 commit cdffd02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions patches/net/minecraft/server/MinecraftServer.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
+ }

Expand All @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carpet/helpers/TickSpeed.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cdffd02

Please sign in to comment.