diff options
Diffstat (limited to 'patches/server/0024-Further-improve-server-tick-loop.patch')
-rw-r--r-- | patches/server/0024-Further-improve-server-tick-loop.patch | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/patches/server/0024-Further-improve-server-tick-loop.patch b/patches/server/0024-Further-improve-server-tick-loop.patch index 03bcb73a6e..bd699ed3ce 100644 --- a/patches/server/0024-Further-improve-server-tick-loop.patch +++ b/patches/server/0024-Further-improve-server-tick-loop.patch @@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b2866090c570129 100644 +index 49de4625c57689a3624ed421c0b03512507c97c3..46e03617bb32e4037d700c1b3698d397bd75de5c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -296,7 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -34,7 +34,7 @@ index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b286609 public final double[] recentTps = new double[ 3 ]; // Spigot end public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files -@@ -1020,6 +1021,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1019,6 +1020,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa { return ( avg * exp ) + ( tps * ( 1 - exp ) ); } @@ -92,7 +92,7 @@ index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b286609 // Spigot End protected void runServer() { -@@ -1034,7 +1086,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1033,7 +1085,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Spigot start Arrays.fill( this.recentTps, 20 ); @@ -104,10 +104,10 @@ index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b286609 while (this.running) { long i; -@@ -1057,15 +1112,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1055,15 +1110,22 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + } } // Spigot start - ++MinecraftServer.currentTickLong; // Paper - track current tick as a long - if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) - { - long curTime = Util.getMillis(); @@ -135,7 +135,7 @@ index d76dae9ce9022308b316080ac48b7030d674cc6b..e9d56d75b7c648f04d3a56942b286609 // Spigot end boolean flag = i == 0L; -@@ -1075,7 +1137,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1073,7 +1135,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount); } |