From e765830ef21705de677ff73c8e1b3516c7296605 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Sun, 5 May 2024 00:13:31 +0900 Subject: [PATCH] More SparklyPaper patches --- .../0009-Port-SparklyPaper-patches.patch | 89 +++++++++++- ...15-Completely-remove-Mojang-Profiler.patch | 22 +-- patches/server/0033-Add-more-MSPT.patch | 136 ++++++++++++++++++ 3 files changed, 234 insertions(+), 13 deletions(-) create mode 100644 patches/server/0033-Add-more-MSPT.patch diff --git a/patches/server/0009-Port-SparklyPaper-patches.patch b/patches/server/0009-Port-SparklyPaper-patches.patch index 175b175..acefddb 100644 --- a/patches/server/0009-Port-SparklyPaper-patches.patch +++ b/patches/server/0009-Port-SparklyPaper-patches.patch @@ -6,8 +6,60 @@ Subject: [PATCH] Port SparklyPaper patches SparklyPower Copyright (C) 2024 SparklyPower -Based on commit: e59f4a805cbfd6f95725a1848a3f352c0a9eb479 +Based on commit: 29212936a832106c4d68e2a2017acbea2fdd3cc4 +diff --git a/src/main/java/io/papermc/paper/command/MSPTCommand.java b/src/main/java/io/papermc/paper/command/MSPTCommand.java +index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..03be23690a94a14d7343526acad67ccf53b85c70 100644 +--- a/src/main/java/io/papermc/paper/command/MSPTCommand.java ++++ b/src/main/java/io/papermc/paper/command/MSPTCommand.java +@@ -78,6 +78,47 @@ public final class MSPTCommand extends Command { + ) + ) + ); ++ ++ // Plazma start - Port SparklyPaper patches; Track World specific 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 level: server.getAllLevels()) { ++ List worldTimes = new ArrayList<>(); ++ worldTimes.addAll(eval(level.tickTimes5s.getTimes())); ++ worldTimes.addAll(eval(level.tickTimes10s.getTimes())); ++ worldTimes.addAll(eval(level.tickTimes60s.getTimes())); ++ ++ sender.sendMessage(text().content("◴ " + level.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) ++ ) ++ ) ++ ); ++ } ++ // Plazma end - Port SparklyPaper patches; Track World specific MSPT ++ + return true; + } + diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java index 62484ebf4550b05182f693a3180bbac5d5fd906d..8b39c463b90db2d4faa33471ddce65f775908f2f 100644 --- a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java @@ -85,7 +137,7 @@ index f164256d59b761264876ca0c85f812d101bfd5de..deaeb134c47da8710afa747bf980bd00 final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2903c9a2480ac505f0931d29ac3c5013037e65f1..5af9b69d58d5364e405f67257fd55fc5e89caa53 100644 +index 2903c9a2480ac505f0931d29ac3c5013037e65f1..39f7a4d3711a182b30d5b8eb77c2354170b26720 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -323,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2849,12 +2852,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop resultConsumer, Consumer dumpConsumer) { @@ -156,7 +156,7 @@ index 5af9b69d58d5364e405f67257fd55fc5e89caa53..be39e6292e4d6571f3b8a92358e35f94 } public void stopRecordingMetrics() { -@@ -2869,6 +2872,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +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 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 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 ee5914eddb70adbda4c24b7c31fc4ca34ce06005..b2a5d324d0f364193c7aee8ef55c50c57f17e250 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -257,8 +257,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop