fix: TAB hex format and chat color codes support

This commit is contained in:
loki5512344 2025-12-30 13:43:12 +01:00
parent ed796a4264
commit 5c1230bc16
3 changed files with 41 additions and 13 deletions

View file

@ -88,7 +88,12 @@ public final class GradientUtil {
private static String formatHex(String hex, boolean useLegacyFormat) {
hex = hex.replace("#", "").toLowerCase();
if (useLegacyFormat) {
return "&#" + hex;
// Формат §x§R§R§G§G§B§B для TAB и других плагинов
StringBuilder sb = new StringBuilder("§x");
for (char c : hex.toCharArray()) {
sb.append("§").append(c);
}
return sb.toString();
} else {
return "<#" + hex + ">";
}