forked from MinecraftUtilities/Backend
support more formatting
This commit is contained in:
parent
bedde3b0eb
commit
924e045a18
@ -75,12 +75,21 @@ public final class ColorUtils {
|
|||||||
nextIsColor = true;
|
nextIsColor = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (nextIsColor) { // Map the current color to its hex code
|
if (nextIsColor && !String.valueOf(character).equals("|")) { // Map the current color to its hex code
|
||||||
String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), "");
|
String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), "");
|
||||||
builder.append("<span style=\"color:").append(color);
|
builder.append("<span style=\"color:").append(color);
|
||||||
if (character == 'l') { // Make the char bold
|
if (character == 'l') { // Make the char bold
|
||||||
builder.append(";font-weight:bold");
|
builder.append(";font-weight:bold");
|
||||||
}
|
}
|
||||||
|
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("\">");
|
builder.append("\">");
|
||||||
nextIsColor = false;
|
nextIsColor = false;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user