Files
Purpur/patches/server/0270-Allow-custom-ChatDecorators.patch
granny 028d47bf9f Updated Upstream (Paper & Pufferfish)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@990be16 Iterate over entity array copy for entity scheduler
PaperMC/Paper@3f6c4b0 Add event for player editing sign (#9300)
PaperMC/Paper@7103f81 Only tick item frames if players can see it (#9377)
PaperMC/Paper@cf0f013 Avoid duplicate death event call for armorstands (#9223)
PaperMC/Paper@8582999 Deprecate duplicate chat completion methods (#9401)
PaperMC/Paper@e4b40dd Fix entity selectors while spectating (#9402)
PaperMC/Paper@82cd69f [ci skip] Update Repo style and change project url in README (#9407)
PaperMC/Paper@2c9c5e4 Fix replenishable container entities save/load existing contents (#9417)
PaperMC/Paper@437e8da Improve command function perm level checks (#9411)
PaperMC/Paper@225c950 Hotfix double entity removal making entity scheduler retire call
PaperMC/Paper@fead63e Add option to disable NoteBlock and Tripwire updates (#9368)

Pufferfish Changes:
pufferfish-gg/Pufferfish@50f3124 Updated Upstream (Paper)
pufferfish-gg/Pufferfish@5673490 Add option to suppress null ID disconnections in logs
pufferfish-gg/Pufferfish@1e911fb Fix issue with that last patch
2023-06-30 12:37:27 -07: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 11bb87a0800e6d1f36be55b91869794e5eef2cd3..8e2c4828b205ca203d8cff21445f53365bb4650a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2672,6 +2672,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) -> {
final io.papermc.paper.adventure.ChatDecorationProcessor processor = new io.papermc.paper.adventure.ChatDecorationProcessor(this, sender, commandSourceStack, message);