mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@c8a4f0b6 Updated Upstream (Paper) PurpurMC/Purpur@e8fe8ece forgot to commit this PurpurMC/Purpur@45bc9f41 Updated Upstream (Paper)
44 lines
2.3 KiB
Diff
44 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sat, 1 Feb 2025 18:55:59 +0300
|
|
Subject: [PATCH] MSPT Tracking for each world
|
|
|
|
|
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
index fd9ef48ac8b23e8b409c00d154dbea27b701e3bc..6a714d59d01eafcd833f05208a948bf33b797392 100644
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
@@ -1735,7 +1735,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
// DivineMC start - Parallel world ticking
|
|
private void tickLevel(ServerLevel serverLevel, BooleanSupplier hasTimeLeft) {
|
|
try {
|
|
+ // DivineMC start - MSPT Tracking for each world
|
|
+ long i = Util.getNanos();
|
|
serverLevel.tick(hasTimeLeft);
|
|
+ long j = Util.getNanos() - i;
|
|
+
|
|
+ serverLevel.tickTimes5s.add(this.tickCount, j);
|
|
+ serverLevel.tickTimes10s.add(this.tickCount, j);
|
|
+ serverLevel.tickTimes60s.add(this.tickCount, j);
|
|
+ // DivineMC end - MSPT Tracking for each world
|
|
} catch (Throwable levelTickingException) {
|
|
CrashReport crashReport = CrashReport.forThrowable(levelTickingException, "Exception ticking world");
|
|
serverLevel.fillReportDetails(crashReport);
|
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
|
index dbc0b9f926f2738f305477730ca1ab91edbd5d2f..4006ad45a53abdc49d8d90150d580ef8c79cf6f0 100644
|
|
--- a/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
|
@@ -596,6 +596,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
}
|
|
// Paper end - chunk tick iteration
|
|
|
|
+ // DivineMC start - MSPT Tracking for each world
|
|
+ public final MinecraftServer.TickTimes tickTimes5s = new MinecraftServer.TickTimes(100);
|
|
+ public final MinecraftServer.TickTimes tickTimes10s = new MinecraftServer.TickTimes(200);
|
|
+ public final MinecraftServer.TickTimes tickTimes60s = new MinecraftServer.TickTimes(1200);
|
|
+ // DivineMC end - MSPT Tracking for each world
|
|
+
|
|
public ServerLevel(
|
|
MinecraftServer server,
|
|
Executor dispatcher,
|