From 46a9d2a4ac1cded587e2d4fdc2a21397563166cd Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 23 Jul 2022 02:56:50 +0100 Subject: [PATCH] Cache Component MOTDs --- patches/server/0008-Adventure.patch | 37 +++++++++++++++++-- patches/server/0012-Timings-v2.patch | 22 +++++------ ...ient-crashes-server-lists-and-Mojang.patch | 6 +-- ...025-Further-improve-server-tick-loop.patch | 14 +++---- patches/server/0034-Optimize-explosions.patch | 4 +- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 4 +- .../0084-Configurable-Player-Collision.patch | 4 +- ...-possibility-for-getServer-singleton.patch | 6 +-- .../0094-Async-GameProfileCache-saving.patch | 4 +- ...le-async-calls-to-restart-the-server.patch | 6 +-- ...oleAppender-for-console-improvements.patch | 14 +++---- ...nt-extended-PaperServerListPingEvent.patch | 4 +- ...dd-Early-Warning-Feature-to-WatchDog.patch | 6 +-- ...52-Asynchronous-chunk-IO-and-loading.patch | 6 +-- ...er-Thread-Pool-and-Thread-Priorities.patch | 4 +- .../0280-Optimize-World-Time-Updates.patch | 4 +- patches/server/0311-Server-Tick-Events.patch | 6 +-- ...isPrimaryThread-and-MinecraftServer-.patch | 6 +-- ...le-Keep-Spawn-Loaded-range-per-world.patch | 6 +-- patches/server/0339-Optimize-Hoppers.patch | 4 +- .../0351-Increase-Light-Queue-Size.patch | 4 +- ...-Add-tick-times-API-and-mspt-command.patch | 12 +++--- .../0385-Improved-Watchdog-Support.patch | 28 +++++++------- .../server/0407-misc-debugging-dumps.patch | 10 ++--- ...Wait-for-Async-Tasks-during-shutdown.patch | 6 +-- ...ld-Difficulty-Remembering-Difficulty.patch | 12 +++--- ...-incremental-chunk-and-player-saving.patch | 6 +-- .../0493-Cache-block-data-strings.patch | 4 +- ...-non-whitelisted-player-when-white-l.patch | 4 +- ...8-Added-ServerResourcesReloadedEvent.patch | 6 +-- patches/server/0569-Add-PaperRegistry.patch | 4 +- patches/server/0583-EntityMoveEvent.patch | 4 +- ...pport-for-hex-color-codes-in-console.patch | 4 +- ...telist-use-configurable-kick-message.patch | 4 +- ...x-and-optimise-world-force-upgrading.patch | 8 ++-- .../0656-Add-PlayerKickEvent-causes.patch | 6 +-- .../0737-Execute-chunk-tasks-mid-tick.patch | 6 +-- ...lStem-registry-when-loading-default-.patch | 4 +- ...vanilla-BiomeProvider-from-WorldInfo.patch | 6 +-- ...sks-fairly-for-worlds-while-waiting-.patch | 6 +-- ...efault-CustomSpawners-in-custom-worl.patch | 4 +- ...o-worldlist-before-initing-the-world.patch | 6 +-- patches/server/0856-Custom-Potion-Mixes.patch | 6 +-- .../0863-Fix-save-problems-on-shutdown.patch | 8 ++-- ...n-on-world-create-while-being-ticked.patch | 10 ++--- 45 files changed, 188 insertions(+), 157 deletions(-) diff --git a/patches/server/0008-Adventure.patch b/patches/server/0008-Adventure.patch index 203e5e3a2..11831caa3 100644 --- a/patches/server/0008-Adventure.patch +++ b/patches/server/0008-Adventure.patch @@ -1367,6 +1367,37 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490 buf.writeComponent(this.header); buf.writeComponent(this.footer); } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 1ad7797dbef61f8e8011ae6db3089939a279071c..327a8f3806d4b3a42f0a7691d578725bf47742fa 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -227,6 +227,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { -@@ -851,6 +851,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { -@@ -1220,15 +1241,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit @@ -823,7 +823,7 @@ index 1ad7797dbef61f8e8011ae6db3089939a279071c..1190d62594c5b1be1c11d55e646ee0ba this.profiler.push("tallying"); long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; -@@ -1238,30 +1262,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -276,7 +276,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop registryreadops, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { super("Server"); @@ -25,7 +25,7 @@ index 032ba4071f7562cd0c0bf3f2de46130692544ef0..d3da5327f7826d10428c9fa8b9848fdb this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.profiler = this.metricsRecorder.getProfiler(); this.onMetricsRecordingStopped = (methodprofilerresults) -> { -@@ -2270,9 +2272,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -352,7 +352,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop comparator; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 14b102e8341d4cb10935e9d247d7451661a02017..a4bdfaaef7f4d340e7e818e7f5ed92f195d91a58 100644 +index 5df920842608f7d4dd4bb24872de1adb3548f20c..b22762ed6731350a1803d80cb1a684a26ca0acac 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -750,6 +750,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser diff --git a/patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index d60e33ca9..cc81e98e4 100644 --- a/patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -58,10 +58,10 @@ index 33ec7786cdf8c32e905d192fc8364418e47404d5..67567eb58beddc06eae4d8e7af3b3c09 return executorService; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7bec6d7b376e382c6266456314eda3ea1cc885ec..3bd5f3249290a3e844b7e88625c2585df398af71 100644 +index d4c5e0f6a31ff0e26fbf1dfc0496bba774811197..338c723c64950aa03e9aab4d9592798ac87beddd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -303,6 +303,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper diff --git a/patches/server/0351-Increase-Light-Queue-Size.patch b/patches/server/0351-Increase-Light-Queue-Size.patch index cb48d2f26..df199500d 100644 --- a/patches/server/0351-Increase-Light-Queue-Size.patch +++ b/patches/server/0351-Increase-Light-Queue-Size.patch @@ -14,10 +14,10 @@ light engine on shutdown... The queue size only puts a cap on max loss, doesn't solve that problem. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4a9addec6c1f08718902da7d3f3628a0900e4c1d..f7427ea6bf11ef837dd38d25cd3abed57de5e8de 100644 +index a4bfec79fa93b45084adbf502d5900bc420300ab..51b33848d9a3af3a9b9dfe482f9f8d9150c57b82 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -777,7 +777,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -83,7 +83,7 @@ index ce7b96819bf8d7e992c2aafd3013e8a9478e500d..53320d5d9cadb8702f82d94bada32db4 // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -292,6 +292,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new Thread(() -> { -@@ -864,6 +867,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -1992,6 +1998,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop(Class apiClass, ResourceKey> resourceKey) { +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5dd7b6669a9afbc7f2d78a7eded7fbf91eadc2b9..3d8917c3baa0c308fe85cafcd332bfbe9bffede9 100644 +index 7b6828a1d93715d39107964ae2a809d6508414ed..70464c6d858132dd21e0ec70154e66c1285a4940 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1998,6 +1998,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper diff --git a/patches/server/0591-Add-support-for-hex-color-codes-in-console.patch b/patches/server/0591-Add-support-for-hex-color-codes-in-console.patch index 6805eaffe..66f4f44c3 100644 --- a/patches/server/0591-Add-support-for-hex-color-codes-in-console.patch +++ b/patches/server/0591-Add-support-for-hex-color-codes-in-console.patch @@ -282,10 +282,10 @@ index 0000000000000000000000000000000000000000..b4d0b7ecd56ab952319946854168c129 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 20d9fc16c4fffd6eaf4d8048dc93068a9e5d3b7c..67c2ad20d0c1d63dcd43d9570fbcb5b9a30f4ee1 100644 +index 28fd97f854b6d86b738b3f3acdcc186d87d54136..666a97330ff03802f42b7d0d80ec083c134a4714 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1670,7 +1670,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop holder = registry.getOrCreateHolderOrThrow(entryKey); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 07d717295beb6fff7d8b3387b895e046bd7482c2..e977a523759f360854fa0a3ab8bbb956f0c0fdc2 100644 +index ec269017109b062db6f73702f36319829c8feaf6..64a4a56d4bb929fddfa415ffea4118cc9c94a4dc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -550,7 +550,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); diff --git a/patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index ac6bc4cbc..352f92941 100644 --- a/patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e977a523759f360854fa0a3ab8bbb956f0c0fdc2..a0f9842bce847d8ff9dfc68801804365ac12e265 100644 +index 64a4a56d4bb929fddfa415ffea4118cc9c94a4dc..f4b15a660a2ebc13c11649c1555ab0d4068f2cb0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -559,7 +559,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver1.getChunkSource().chunkMap.hasWork(); })) { -@@ -965,9 +972,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return true; }, false); @@ -42,7 +42,7 @@ index ecaa4d9ff28551b7039f3489f1884d3b664c8ce6..a1b3da5cafe2ddae53f088bb18bacc3e } this.saveAllChunks(false, true, false); -@@ -1264,6 +1273,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1525,6 +1526,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper -@@ -1572,6 +1574,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop