fix stupid legacy chat garbage

This commit is contained in:
Riley Park 2021-02-22 00:45:21 -08:00
parent b856bf08b9
commit e1763a2679

View file

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.wrapped = wrapped;
+ }
+
+ IChatBaseComponent deepConverted() {
+ public IChatBaseComponent deepConverted() {
+ IChatBaseComponent converted = this.converted;
+ if (converted == null) {
+ converted = PaperAdventure.WRAPPER_AWARE_SERIALIZER.serialize(this.wrapped);
@ -2901,3 +2901,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public String getDisplayName() throws IllegalStateException {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
@@ -0,0 +0,0 @@ public final class CraftChatMessage {
public static String fromComponent(IChatBaseComponent component) {
if (component == null) return "";
+ if (component instanceof io.papermc.paper.adventure.AdventureComponent) component = ((io.papermc.paper.adventure.AdventureComponent) component).deepConverted();
StringBuilder out = new StringBuilder();
boolean hadFormat = false;