From 69ffbec34a22d20701e62481c3718fa2f0bbc2ef Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 2 Oct 2024 13:49:39 +0200 Subject: [PATCH] Fix hex color check --- patches/server/0010-Adventure.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index a30b08aa61..e21440350a 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -5603,9 +5603,18 @@ index 4d586e1375ed8782939c9d480479e0dd981f8cbc..7900adb0b158bc17dd792dd082c33854 + } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index ff040613083c015d9c52c0995591b64305fd5018..1b552b3f05ac7fc44450de4b1ec78907a0f62424 100644 +index ff040613083c015d9c52c0995591b64305fd5018..95444fd9fecc5bda5462ca8dfeca82c5318f0895 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +@@ -90,7 +90,7 @@ public final class CraftChatMessage { + this.hex.append(c); + + if (this.hex.length() == 7) { +- this.modifier = StringMessage.RESET.withColor(TextColor.parseColor(this.hex.toString()).result().get()); ++ this.modifier = StringMessage.RESET.withColor(TextColor.parseColor(this.hex.toString()).result().orElse(null)); // Paper + this.hex = null; + } + } else if (format.isFormat() && format != ChatFormatting.RESET) { @@ -264,6 +264,7 @@ public final class CraftChatMessage { public static String fromComponent(Component component) {