mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
58 lines
2.4 KiB
Diff
58 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
|
Date: Mon, 6 Nov 2023 21:54:33 -0300
|
|
Subject: [PATCH] Track how much MSPT each world used
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/command/MSPTCommand.java b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
|
index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..601198a33adb29316b0617d5390d1620b7c1095c 100644
|
|
--- a/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
|
+++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
|
@@ -78,6 +78,46 @@ public final class MSPTCommand extends Command {
|
|
)
|
|
)
|
|
);
|
|
+
|
|
+ // SparklyPaper start - track world's MSPT
|
|
+ sender.sendMessage(text());
|
|
+ sender.sendMessage(text().content("World tick times ").color(GOLD)
|
|
+ .append(text().color(YELLOW)
|
|
+ .append(
|
|
+ text("("),
|
|
+ text("avg", GRAY),
|
|
+ text("/"),
|
|
+ text("min", GRAY),
|
|
+ text("/"),
|
|
+ text("max", GRAY),
|
|
+ text(")")
|
|
+ )
|
|
+ ).append(
|
|
+ text(" from last 5s"),
|
|
+ text(",", GRAY),
|
|
+ text(" 10s"),
|
|
+ text(",", GRAY),
|
|
+ text(" 1m"),
|
|
+ text(":", YELLOW)
|
|
+ )
|
|
+ );
|
|
+ for (net.minecraft.server.level.ServerLevel serverLevel : server.getAllLevels()) {
|
|
+ List<Component> worldTimes = new ArrayList<>();
|
|
+ worldTimes.addAll(eval(serverLevel.tickTimes5s.getTimes()));
|
|
+ worldTimes.addAll(eval(serverLevel.tickTimes10s.getTimes()));
|
|
+ worldTimes.addAll(eval(serverLevel.tickTimes60s.getTimes()));
|
|
+
|
|
+ sender.sendMessage(text().content("◴ " + serverLevel.getWorld().getName() + ": ").color(GOLD)
|
|
+ .append(text().color(GRAY)
|
|
+ .append(
|
|
+ worldTimes.get(0), SLASH, worldTimes.get(1), SLASH, worldTimes.get(2), text(", ", YELLOW),
|
|
+ worldTimes.get(3), SLASH, worldTimes.get(4), SLASH, worldTimes.get(5), text(", ", YELLOW),
|
|
+ worldTimes.get(6), SLASH, worldTimes.get(7), SLASH, worldTimes.get(8)
|
|
+ )
|
|
+ )
|
|
+ );
|
|
+ }
|
|
+ // SparklyPaper end
|
|
return true;
|
|
}
|
|
|