From bd62f2c2dd5ddb3d988f6c5bf227e02b655ca41c Mon Sep 17 00:00:00 2001 From: Jason <11360596+jpenilla@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:19:23 -0700 Subject: [PATCH] Fix chat messages being logged without formatting to console (#9058) --- patches/server/0010-Adventure.patch | 35 ++++++++++++++++--- patches/server/0014-Timings-v2.patch | 20 +++++------ .../server/0018-Rewrite-chunk-system.patch | 26 +++++++------- ...ient-crashes-server-lists-and-Mojang.patch | 4 +-- ...031-Further-improve-server-tick-loop.patch | 16 ++++----- patches/server/0040-Optimize-explosions.patch | 4 +-- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 4 +-- .../0088-Configurable-Player-Collision.patch | 4 +-- ...-possibility-for-getServer-singleton.patch | 8 ++--- .../0098-Async-GameProfileCache-saving.patch | 4 +-- ...le-async-calls-to-restart-the-server.patch | 8 ++--- ...oleAppender-for-console-improvements.patch | 12 +++---- ...nt-extended-PaperServerListPingEvent.patch | 4 +-- ...dd-Early-Warning-Feature-to-WatchDog.patch | 6 ++-- ...er-Thread-Pool-and-Thread-Priorities.patch | 4 +-- .../0279-Optimize-World-Time-Updates.patch | 4 +-- .../0296-Async-command-map-building.patch | 4 +-- patches/server/0308-Server-Tick-Events.patch | 6 ++-- ...le-Keep-Spawn-Loaded-range-per-world.patch | 6 ++-- .../0342-Increase-Light-Queue-Size.patch | 4 +-- ...-Add-tick-times-API-and-mspt-command.patch | 8 ++--- .../0375-Improved-Watchdog-Support.patch | 26 +++++++------- .../server/0394-misc-debugging-dumps.patch | 10 +++--- ...Wait-for-Async-Tasks-during-shutdown.patch | 6 ++-- ...ld-Difficulty-Remembering-Difficulty.patch | 8 ++--- ...-incremental-chunk-and-player-saving.patch | 6 ++-- .../0473-Cache-block-data-strings.patch | 6 ++-- ...-non-whitelisted-player-when-white-l.patch | 4 +-- ...5-Added-ServerResourcesReloadedEvent.patch | 6 ++-- patches/server/0560-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 | 6 ++-- .../0629-Add-PlayerKickEvent-causes.patch | 6 ++-- .../0700-Execute-chunk-tasks-mid-tick.patch | 6 ++-- ...vanilla-BiomeProvider-from-WorldInfo.patch | 8 ++--- ...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/0804-Custom-Potion-Mixes.patch | 4 +-- ...n-on-world-create-while-being-ticked.patch | 10 +++--- ...ix-plugin-loggers-on-server-shutdown.patch | 6 ++-- patches/server/0967-Optimize-Hoppers.patch | 4 +-- 43 files changed, 183 insertions(+), 158 deletions(-) diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index d9414dbd24..93f765d060 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2114,10 +2114,18 @@ index 5f051cb22ae77f4d8994b07ac5b963bd0ff05673..7952635a963e28cb670c8f4869664103 list.forEach((loader) -> { Registry registry = loader.getFirst(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5725631835ea68802c75934cd85d5c1b1a78d358..0b859ebcc2c53e74615feca5c864136586c1523b 100644 +index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf937673ba4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -244,6 +244,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { + + public static final Logger LOGGER = LogUtils.getLogger(); ++ public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper + public static final String VANILLA_BRAND = "vanilla"; + private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; + private static final int TICK_STATS_SPAN = 100; +@@ -244,6 +245,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements CommandSource, AutoCloseable { -@@ -864,6 +864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop= 5000000000L) { -@@ -1210,15 +1231,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit @@ -823,7 +823,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0 this.profiler.push("tallying"); long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; -@@ -1228,8 +1252,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); @@ -12735,7 +12735,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff ((MinecraftServer) atomicreference.get()).runServer(); }, "Server thread"); -@@ -584,7 +584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit -@@ -1102,6 +1091,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -293,7 +293,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit long j = i / 50L; -@@ -991,12 +1043,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -@@ -2333,9 +2335,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> levels; private PlayerList playerList; private volatile boolean running; @@ -41,7 +41,7 @@ index 776f7a27c4e85e713863f8fd0d37fc61e2bb0e49..b248a4ab47728c078dbc922896964e0e private boolean stopped; private int tickCount; protected final Proxy proxy; -@@ -904,7 +905,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; -@@ -369,7 +369,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; @@ -83,7 +83,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b // CraftBukkit end // Spigot start public static final int TPS = 20; -@@ -309,6 +309,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system -@@ -887,6 +890,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2050,6 +2056,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper diff --git a/patches/server/0568-Add-support-for-hex-color-codes-in-console.patch b/patches/server/0568-Add-support-for-hex-color-codes-in-console.patch index ec9dd842c7..9c48e211e1 100644 --- a/patches/server/0568-Add-support-for-hex-color-codes-in-console.patch +++ b/patches/server/0568-Add-support-for-hex-color-codes-in-console.patch @@ -283,10 +283,10 @@ index 0000000000000000000000000000000000000000..b9922b07cb105618390187d98acdf89e + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3c30d51cc497f2aa4071fed1ef9a5c93ddd358ab..ed3ec53f11cf2be94b82a779d89e8d4b7819172f 100644 +index 7ad22703d50667849e195d3e7b6792078104425c..97ebd8d4bb8f0558d8b74782c810c5db0485d802 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1706,7 +1706,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); @@ -18,7 +18,7 @@ index 87e5959a495eaccf3e6ec1102fb8a3f3edcc0cfe..b5967ac7772d1bc0768a816820375d80 biomeProvider = gen.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1e54fc63253a12f2dbc248965d0027e526a3cc86..39c0300d84e44d499b26ea365fc2e038fda58196 100644 +index 8543dd8e933364befa5d29f80f53408a2cd2606b..532ea1dd6548264f4ccc639d7cccab39a851a1ad 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1217,7 +1217,7 @@ public final class CraftServer implements Server { @@ -31,7 +31,7 @@ index 1e54fc63253a12f2dbc248965d0027e526a3cc86..39c0300d84e44d499b26ea365fc2e038 biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3ec2674a3ebc2540b9832e7bd3c99d5c1373f47d..5086fcbbd908f5759653ce44b8524345b479d2b8 100644 +index e955b72d6a26224c39059fa56874b5e47384b5f4..8fcc553b6f1bf62fb9febb46402940039c37606a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -199,6 +199,30 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0797-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0797-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index e2d82963db..8908089517 100644 --- a/patches/server/0797-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0797-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b5967ac7772d1bc0768a816820375d80e249bf8f..6e6cec6f6dd0c6e3504d43cbe73310e57f42eb31 100644 +index cbbb0ff40488c430d15c2ed054d1b2880c9e92b7..c2ad62deea2a076aae53f17cbdacda1f5a92d2be 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1308,6 +1308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1485,7 +1486,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper -@@ -1563,6 +1566,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper