Files
Purpur/patches/server/0278-Allow-custom-ChatDecorators.patch
Encode42 fe3250cfec Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@c1bca9a Add exploded block state to BlockExplodeEvent (#6818)
PaperMC/Paper@94373f0 Fix OfflinePlayer#getPlayerProfile returning deprecated type (#8543)
PaperMC/Paper@7b52db5 Fix buffer-joins-to-world patch
PaperMC/Paper@048ee58 Fix OfflinePlayer getPlayerProfile return type (#8710)
PaperMC/Paper@e05ba98 Avoid to spam the transform event for hoglin->zoglin conversion (#8712)
PaperMC/Paper@8e83c3c Deprecate ProjectileCollideEvent (#8678)
PaperMC/Paper@c59922d Expose signed message in chat events (#8694)
PaperMC/Paper@5717b84 Add config option for spider worldborder climbing (#6448)
PaperMC/Paper@e6f61f7 fix ArmorStandMeta not applying false flags (#8632)
PaperMC/Paper@47abd1c Add EntityPushedByEntityEvent (#7704)
PaperMC/Paper@f26e9cc Tadpole lock API (#8297)
PaperMC/Paper@3331501 Use team display name for quit message (#7127)
PaperMC/Paper@1975fbe Respect SpigotConfig logCommands & fix stopDancing() NPE (#8715)
PaperMC/Paper@78a91df Fix (again) Player#getPlayerProfile no such method error (#8722)
PaperMC/Paper@52718db Updated Upstream (Bukkit/CraftBukkit) (#8714)
PaperMC/Paper@2040c1e Player Flying Fall Damage API (#5357)
2022-12-27 15:55:36 -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 15285d2b132a82a7b7f9c2c558e1157b7585d43f..7b37dc81bca016ecad7a89013326053f74ba0ca1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2637,6 +2637,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);