Further improve server tick loop
Improves how the catchup buffer is handled, allowing it to roll both ways increasing the effeciency of the thread sleep so it only will sleep once. Also increases the buffer of the catchup to ensure server stays at 20 TPS unless extreme conditions Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
This commit is contained in:
@ -2680,7 +2680,11 @@ public final class CraftServer implements Server {
|
||||
|
||||
@Override
|
||||
public double[] getTPS() {
|
||||
return new double[]{0, 0, 0}; // TODO
|
||||
return new double[] {
|
||||
net.minecraft.server.MinecraftServer.getServer().tps1.getAverage(),
|
||||
net.minecraft.server.MinecraftServer.getServer().tps5.getAverage(),
|
||||
net.minecraft.server.MinecraftServer.getServer().tps15.getAverage()
|
||||
};
|
||||
}
|
||||
|
||||
// Paper start - adventure sounds
|
||||
|
||||
Reference in New Issue
Block a user