Chunk system patch

This commit is contained in:
Spottedleaf
2023-09-22 13:13:57 -07:00
parent 05f9968013
commit 9bf842c13e
52 changed files with 625 additions and 370 deletions

View File

@@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper End
// Spigot End
protected void runServer() {
public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start
@@ -99,6 +99,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop
+ lastTick = start - TICK_TIME; // Paper
while (this.running) {
// Paper start - rewrite chunk system
// guarantee that nothing can stop the server from halting if it can at least still tick
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw this.chunkSystemCrash;
}
// Paper end - rewrite chunk system
- long i = (curTime = Util.getMillis()) - this.nextTickTime;
+ long i = ((curTime = System.nanoTime()) / (1000L * 1000L)) - this.nextTickTime; // Paper