Deprecate ChatColor (#9069)

All API that uses it is deprecated
This commit is contained in:
Jake Potrebic 2023-04-02 11:53:29 -07:00 committed by GitHub
parent 1d2fe64da8
commit 9893e2b734
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 169 additions and 94 deletions

View file

@ -673,10 +673,10 @@ index 0000000000000000000000000000000000000000..45830cf2b42c2c983cef922c6355e5d6
+}
diff --git a/src/main/java/io/papermc/paper/adventure/DisplayNames.java b/src/main/java/io/papermc/paper/adventure/DisplayNames.java
new file mode 100644
index 0000000000000000000000000000000000000000..3957f68182e8f7a773613a687f1d9a0cfa4f066c
index 0000000000000000000000000000000000000000..d496a9a6ad229e42f1c44e31eafa6974b9faced5
--- /dev/null
+++ b/src/main/java/io/papermc/paper/adventure/DisplayNames.java
@@ -0,0 +1,24 @@
@@ -0,0 +1,25 @@
+package io.papermc.paper.adventure;
+
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@ -692,6 +692,7 @@ index 0000000000000000000000000000000000000000..3957f68182e8f7a773613a687f1d9a0c
+ return getLegacy(player.getHandle());
+ }
+
+ @SuppressWarnings("deprecation") // Valid suppress due to supporting legacy display name formatting
+ public static String getLegacy(final ServerPlayer player) {
+ final String legacy = player.displayName;
+ if (legacy != null) {