mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@a15152e Allow old behavior for CommandRegisteredEvent (#8249) PaperMC/Paper@0118c0b Improve MojangAPI docs and replace @Deprecated with @ApiStatus.Experimental on draft APIs (#8261) PaperMC/Paper@3624637 Improve documentation of Inventory#removeItem (#8263) PaperMC/Paper@a47301e Fix Player#chat kicking all clients (#8262) PaperMC/Paper@78b19f8 Separate Command Sending to Separate Thread Pool (#8170)
28 lines
1.7 KiB
Diff
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 89c672b03e7bc932e2afb46e708a49a8fe66ff76..100460d26fbb645a138f1883335ce7838b243a19 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -2629,6 +2629,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);
|