fix: TAB hex format and chat color codes support
This commit is contained in:
parent
ed796a4264
commit
5c1230bc16
3 changed files with 41 additions and 13 deletions
|
|
@ -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 + ">";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue