Purpur/patches/server/0286-Allow-custom-ChatDecorators.patch
BillyGalbreath 478d55ec4d
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@6d63005 Fix setEggCount method from TurtleLayEggEvent (#8385)
PaperMC/Paper@abe53a7 Fix typos in isTickingWorlds API javadocs (#8382)
PaperMC/Paper@01a1387 Rewrite chunk system (#8177)
2022-09-26 04:35:03 -05:00

28 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Mon, 11 Jul 2022 20:44:19 -0500
Subject: [PATCH] Allow custom ChatDecorators
Requires NMS to utilize. I'll write an API for this once our upstreams calm down with the changes.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7836fe7ec1afde26989451e51a7ab63195e5af87..832218df741197b6f15746b1d683ce1d3a16a03f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2627,6 +2627,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon(true).setNameFormat("Async Chat Thread - #%d").setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build()); // Paper
public ChatDecorator getChatDecorator() {
+ // Purpur start
+ return this.chatDecorator;
+ }
+ public void setChatDecorator(ChatDecorator chatDecorator) {
+ this.chatDecorator = chatDecorator;
+ }
+ private ChatDecorator chatDecorator = getPaperHardcodedChatDecorator();
+ public ChatDecorator getPaperHardcodedChatDecorator() {
+ // Purpur end
// Paper start - moved to ChatPreviewProcessor
return ChatDecorator.create((sender, commandSourceStack, message, isPreview) -> {
final io.papermc.paper.adventure.ChatDecorationProcessor processor = new io.papermc.paper.adventure.ChatDecorationProcessor(this, sender, commandSourceStack, message, isPreview);