From 37b048c2a9063b2114c4d8ca7edd224cc22f532b Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 16 Apr 2024 21:01:05 +0100 Subject: [PATCH] pls work --- .../mcutils/backend/common/ColorUtils.java | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/java/xyz/mcutils/backend/common/ColorUtils.java b/src/main/java/xyz/mcutils/backend/common/ColorUtils.java index 256c6aa..f3baf54 100644 --- a/src/main/java/xyz/mcutils/backend/common/ColorUtils.java +++ b/src/main/java/xyz/mcutils/backend/common/ColorUtils.java @@ -70,30 +70,31 @@ public final class ColorUtils { } for (char character : input.toCharArray()) { - // Found color symbol, next character is the color code - if (character == '§') { + if (character == '§') { // Found color symbol nextIsColor = true; - builder.append(character); // Append the color symbol to the HTML continue; } if (nextIsColor) { // Apply color formatting // Map the current color to its hex code String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), ""); - builder.append(""); } - if (character == 'n') { // Make the char underlined - builder.append(";text-decoration:underline"); - } - if (character == 'o') { // Make the char italic - builder.append(";font-style:italic"); - } - if (character == 'm') { // Make the char strikethrough - builder.append(";text-decoration:line-through"); - } - builder.append("\">"); nextIsColor = false; // Reset the flag continue; }