mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 14:33:09 +01:00
Fix /tps (#2066)
This commit is contained in:
parent
a3ad19e1a6
commit
50c66c63aa
1 changed files with 6 additions and 5 deletions
|
@ -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 2fc8c192b..db60cbc7b 100644
|
||||
index 2fc8c192b3..cf7a75b2e2 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
@ -99,9 +99,10 @@ index 2fc8c192b..db60cbc7b 100644
|
|||
+ long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop
|
||||
+ lastTick = start - TICK_TIME; // Paper
|
||||
while (this.isRunning) {
|
||||
long i = (curTime = SystemUtils.getMonotonicMillis()) - this.nextTick;
|
||||
- long i = (curTime = SystemUtils.getMonotonicMillis()) - this.nextTick;
|
||||
+ long i = ((curTime = System.nanoTime()) / (1000L * 1000L)) - this.nextTick; // Paper
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
if (i > 5000L && this.nextTick - this.lastOverloadTime >= 30000L) { // CraftBukkit
|
||||
long j = i / 50L;
|
||||
|
||||
if (server.getWarnOnOverload()) // CraftBukkit
|
||||
|
@ -139,7 +140,7 @@ index 2fc8c192b..db60cbc7b 100644
|
|||
if (this.T) {
|
||||
this.T = false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 801ea70ac..f9563d038 100644
|
||||
index e8a905c815..d97cba9c04 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
|
@ -161,7 +162,7 @@ index 801ea70ac..f9563d038 100644
|
|||
{
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
index be2e31dea..6d21c3269 100644
|
||||
index be2e31deae..6d21c32692 100644
|
||||
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
|
Loading…
Reference in a new issue