From 3c07f1c95ef689953ba6a5ae4cecd2f1e68a049d Mon Sep 17 00:00:00 2001 From: Riccio Date: Wed, 5 Aug 2026 15:49:12 -0300 Subject: [PATCH] =?UTF-8?q?fixed=20an=20issue=20where=20trailing=20=C2=A7?= =?UTF-8?q?=20or=20=C2=A7char=20would=20lead=20to=20a=20network=20protocol?= =?UTF-8?q?=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hypixelchattabs/HypixelChatTabsClient.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/client/java/yellowbirb/hypixelchattabs/HypixelChatTabsClient.java b/src/client/java/yellowbirb/hypixelchattabs/HypixelChatTabsClient.java index d4752e5..89cda88 100644 --- a/src/client/java/yellowbirb/hypixelchattabs/HypixelChatTabsClient.java +++ b/src/client/java/yellowbirb/hypixelchattabs/HypixelChatTabsClient.java @@ -18,21 +18,10 @@ public void onInitializeClient() { } private static String removeFormatting(String string) { - StringBuilder stringBuilder = new StringBuilder(string); - int deleted = 0; - for (int i = 0; i < string.length(); i++) { - while (string.charAt(i) == '§') { - stringBuilder.deleteCharAt(i-deleted); - deleted++; - i++; - stringBuilder.deleteCharAt(i-deleted); - deleted++; - i++; - } - } - return stringBuilder.toString(); + return string == null ? "" : string.replaceAll("§.?", ""); } + public static boolean filter(Component text) { String message = removeFormatting(text.getString());