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

Paper Changes:
PaperMC/Paper@c1ea550 Remove more outdated config settings (#9358)
PaperMC/Paper@3a03739 Add method to get ungenerated chunk from long key (#9254)
PaperMC/Paper@072b78a Add trail ruins structure set seed in spigot config (#9327)
PaperMC/Paper@faf9a65 Disable BukkitMirrorTest
PaperMC/Paper@873533b Add method to remove all active potion effects (#9361)
PaperMC/Paper@275173e Updated Upstream (Bukkit/CraftBukkit)
PaperMC/Paper@976b95c Temp: Pre-init PlayerChunkLoaderData in order to prepopulate the BFS lookup cache because potatos (Closes #9338)
PaperMC/Paper@d6d4c78 Move some Folia API to Paper for easy compat (#9360)
PaperMC/Paper@b1fe756 Revert "Move some Folia API to Paper for easy compat (#9360)"
PaperMC/Paper@1f5bec7 Pull Folia API take two
PaperMC/Paper@3756f5b Properly Cancel Usable Items (#9225)
2023-06-20 15:54:20 -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 cb579a3167518e96e40ba0203f85aad10064e8d5..b6abc36cd0209ebdd6deb233bbe7b16dd139c91b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2670,6 +2670,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);