[Purpur Changes] PlazmaMC/Purpur@ceeec1c: work PlazmaMC/Purpur@e8f8f93: Updated Upstream (Paper, Pufferfish) [Paper Changes] PaperMC/Paper@f175193: Expose server build information (#10729) PaperMC/Paper@d8d59e0: Fix NPE sending resource pack without prompt PaperMC/Paper@5a9afbe: Fixes issues in the suppress dismount cancellation patch (#10735) PaperMC/Paper@0ad09de: Make PaperSimplePluginClassLoader show class which is not found PaperMC/Paper@b3b3406: fix CompassMeta not being correct (#10737) PaperMC/Paper@591521e: Check for more correct profile validation (#10730) PaperMC/Paper@7d2e5c3: Add an 'empty' RecipeChoice for certain ingredient slots (#10710) PaperMC/Paper@9bf4855: Add a better warning message than "Server performance will be affected" for CommandRegisteredEvent use (#10754) PaperMC/Paper@66cb880: Remove ThreadedWorldUpgrader patch PaperMC/Paper@980cff9: Fix compile PaperMC/Paper@d3ffa62: fix default item attributes PaperMC/Paper@b149584: Always show command exception stack traces in logs (#10766) PaperMC/Paper@a9201d4: [ci skip] Move logic in our patches to ItemType/BlockType (#10772) PaperMC/Paper@3de408e: Fix equipment slot and group API (#10767) PaperMC/Paper@d408381: Print CommandRegisteredEvent deprecation warnings again (#10756) PaperMC/Paper@6de7a1f: Improve default item attributes API (#10765) PaperMC/Paper@2a90732: Remove incorrect logic for Fireball#setVelocity (#10764) PaperMC/Paper@5e7b65a: Allow using PluginLoader classpath API from Bukkit plugins (#10758) PaperMC/Paper@3004717: Do not re-wrap vanilla goals (#10751) PaperMC/Paper@377733d: Use getter/setter on Mob for equipment drop chances (#10780) PaperMC/Paper@dff591d: Allow to define new map cursor types (#10782) PaperMC/Paper@4fd3ac0: [ci skip] Update Player#getListeningPluginChannels Jdoc (#10778) PaperMC/Paper@535dca5: Fix a few issues with ItemMeta (#10740) PaperMC/Paper@26e90b9: Fix CraftMetaBlockState for data components (#10731) PaperMC/Paper@f0bd0cc: Expose anvil cost in the API (#10682) PaperMC/Paper@41bee55: Fix NPE for color-related metas PaperMC/Paper@4e10fad: reset meta block state on BlockStateMeta#setBlockState
137 lines
7.6 KiB
Diff
137 lines
7.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaKR93 <dev@alpha93.kr>
|
|
Date: Sun, 5 May 2024 00:01:03 +0900
|
|
Subject: [PATCH] Add more MSPT
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/command/MSPTCommand.java b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
|
index 03be23690a94a14d7343526acad67ccf53b85c70..416c0a736edf47f76a37be0bc5fe8678cf89cdb3 100644
|
|
--- a/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
|
+++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java
|
|
@@ -45,8 +45,10 @@ public final class MSPTCommand extends Command {
|
|
MinecraftServer server = MinecraftServer.getServer();
|
|
|
|
List<Component> times = new ArrayList<>();
|
|
+ times.addAll(eval(server.tickTimes1s.getTimes())); // Plazma - Add more MSPT
|
|
times.addAll(eval(server.tickTimes5s.getTimes()));
|
|
times.addAll(eval(server.tickTimes10s.getTimes()));
|
|
+ times.addAll(eval(server.tickTimes30s.getTimes())); // Plazma - Add more MSPT
|
|
times.addAll(eval(server.tickTimes60s.getTimes()));
|
|
|
|
sender.sendMessage(text().content("Server tick times ").color(GOLD)
|
|
@@ -61,12 +63,18 @@ public final class MSPTCommand extends Command {
|
|
text(")")
|
|
)
|
|
).append(
|
|
- text(" from last 5s"),
|
|
+ // Plazma start - Add more MSPT
|
|
+ text(" from last 1s"),
|
|
+ text(",", GRAY),
|
|
+ text(" 5s"),
|
|
text(",", GRAY),
|
|
text(" 10s"),
|
|
text(",", GRAY),
|
|
+ text(" 30s"),
|
|
+ text(",", GRAY),
|
|
text(" 1m"),
|
|
text(":", YELLOW)
|
|
+ // Plazma end - Add more MSPT
|
|
)
|
|
);
|
|
sender.sendMessage(text().content("◴ ").color(GOLD)
|
|
@@ -74,7 +82,11 @@ public final class MSPTCommand extends Command {
|
|
.append(
|
|
times.get(0), SLASH, times.get(1), SLASH, times.get(2), text(", ", YELLOW),
|
|
times.get(3), SLASH, times.get(4), SLASH, times.get(5), text(", ", YELLOW),
|
|
- times.get(6), SLASH, times.get(7), SLASH, times.get(8)
|
|
+ // Plazma start - Add more MSPT
|
|
+ times.get(6), SLASH, times.get(7), SLASH, times.get(8), text(", ", YELLOW),
|
|
+ times.get(9), SLASH, times.get(10), SLASH, times.get(11), text(", ", YELLOW),
|
|
+ times.get(12), SLASH, times.get(13), SLASH, times.get(14), text(", ", YELLOW)
|
|
+ // Plazma end - Add more MSPT
|
|
)
|
|
)
|
|
);
|
|
@@ -93,18 +105,26 @@ public final class MSPTCommand extends Command {
|
|
text(")")
|
|
)
|
|
).append(
|
|
- text(" from last 5s"),
|
|
+ // Plazma start - Add more MSPT
|
|
+ text(" from last 1s"),
|
|
+ text(",", GRAY),
|
|
+ text(" 5s"),
|
|
text(",", GRAY),
|
|
text(" 10s"),
|
|
text(",", GRAY),
|
|
+ text(" 30s"),
|
|
+ text(",", GRAY),
|
|
text(" 1m"),
|
|
text(":", YELLOW)
|
|
+ // Plazma end - Add more MSPT
|
|
)
|
|
);
|
|
for (net.minecraft.server.level.ServerLevel level: server.getAllLevels()) {
|
|
List<Component> worldTimes = new ArrayList<>();
|
|
+ worldTimes.addAll(eval(level.tickTimes1s.getTimes())); // Plazma - Add more MSPT
|
|
worldTimes.addAll(eval(level.tickTimes5s.getTimes()));
|
|
worldTimes.addAll(eval(level.tickTimes10s.getTimes()));
|
|
+ worldTimes.addAll(eval(level.tickTimes30s.getTimes())); // Plazma - Add more MSPT
|
|
worldTimes.addAll(eval(level.tickTimes60s.getTimes()));
|
|
|
|
sender.sendMessage(text().content("◴ " + level.getWorld().getName() + ": ").color(GOLD)
|
|
@@ -112,7 +132,11 @@ public final class MSPTCommand extends Command {
|
|
.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)
|
|
+ // Plazma start - Add more MSPT
|
|
+ worldTimes.get(6), SLASH, worldTimes.get(7), SLASH, worldTimes.get(8), text(", ", YELLOW),
|
|
+ worldTimes.get(9), SLASH, worldTimes.get(10), SLASH, worldTimes.get(11), text(", ", YELLOW),
|
|
+ worldTimes.get(12), SLASH, worldTimes.get(13), SLASH, worldTimes.get(14), text(", ", YELLOW)
|
|
+ // Plazma end - Add more MSPT
|
|
)
|
|
)
|
|
);
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 4782f19409d300fbcaa952ae0dd6a0577ade5f7b..f926376ee95b28a9c09a1ad87223f89f1c28f50e 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -254,8 +254,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
private final long[] tickTimesNanos;
|
|
private long aggregatedTickTimesNanos;
|
|
// Paper start - Add tick times API and /mspt command
|
|
+ public final TickTimes tickTimes1s = new TickTimes(20); // Plazma - Add more MSPT
|
|
public final TickTimes tickTimes5s = new TickTimes(100);
|
|
public final TickTimes tickTimes10s = new TickTimes(200);
|
|
+ public final TickTimes tickTimes30s = new TickTimes(600); // Plazma - Add more MSPT
|
|
public final TickTimes tickTimes60s = new TickTimes(1200);
|
|
// Paper end - Add tick times API and /mspt command
|
|
@Nullable
|
|
@@ -1821,8 +1823,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
worldserver.tick(shouldKeepTicking);
|
|
long after = Util.getNanos() - before;
|
|
|
|
+ worldserver.tickTimes1s.add(this.tickCount, after); // Plazma - Add more MSPT
|
|
worldserver.tickTimes5s.add(this.tickCount, after);
|
|
worldserver.tickTimes10s.add(this.tickCount, after);
|
|
+ worldserver.tickTimes30s.add(this.tickCount, after); // Plazma - Add more MSPT
|
|
worldserver.tickTimes60s.add(this.tickCount, after);
|
|
// Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
|
// Paper start
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index 508e01e9ef41f006e6d9be71969c0d82dc646628..15548aac320ae6d707cab4a61dfc99eaebb06634 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -234,8 +234,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
public boolean hasRidableMoveEvent = false; // Purpur
|
|
|
|
// Plazma start - Port SparklyPaper patches; Track World specific MSPT
|
|
+ public final MinecraftServer.TickTimes tickTimes1s = new MinecraftServer.TickTimes(20); // Plazma - Add more MSPT
|
|
public final MinecraftServer.TickTimes tickTimes5s = new MinecraftServer.TickTimes(100);
|
|
public final MinecraftServer.TickTimes tickTimes10s = new MinecraftServer.TickTimes(200);
|
|
+ public final MinecraftServer.TickTimes tickTimes30s = new MinecraftServer.TickTimes(600); // Plazma - Add more MSPT
|
|
public final MinecraftServer.TickTimes tickTimes60s = new MinecraftServer.TickTimes(1200);
|
|
// Plazma end - Port SparklyPaper patches; Track World specific MSPT
|
|
|