From 08be02ff7374e341a88b39f4e81c00e937ecb7f6 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 16 Apr 2024 21:14:19 +0100 Subject: [PATCH] revert extra formatting (fuck html) --- .../mcutils/backend/common/ColorUtils.java | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/src/main/java/xyz/mcutils/backend/common/ColorUtils.java b/src/main/java/xyz/mcutils/backend/common/ColorUtils.java index f3baf54..8e628c6 100644 --- a/src/main/java/xyz/mcutils/backend/common/ColorUtils.java +++ b/src/main/java/xyz/mcutils/backend/common/ColorUtils.java @@ -70,32 +70,15 @@ public final class ColorUtils { } for (char character : input.toCharArray()) { - if (character == '§') { // Found color symbol + // Found color symbol, next color is the color + if (character == '§') { nextIsColor = true; continue; } - if (nextIsColor) { // Apply color formatting - // Map the current color to its hex code + if (nextIsColor) { // Map the current color to its hex code String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), ""); - // Check if the current character is a valid color code - if (!color.isEmpty()) { - builder.append(""); - } - nextIsColor = false; // Reset the flag + builder.append(""); + nextIsColor = false; continue; } if (character == ' ') { // Preserve space character