Add support for RGB colors using the color char

Examples include:
`&x00002a00002b&lText`
This commit is contained in:
games647
2022-06-24 16:21:53 +02:00
parent 5e159cac64
commit f182adc3bc
2 changed files with 28 additions and 1 deletions
@@ -61,7 +61,7 @@ public class CommonUtil {
public static String translateColorCodes(String rawMessage) {
char[] chars = rawMessage.toCharArray();
for (int i = 0; i < chars.length - 1; i++) {
if (chars[i] == COLOR_CHAR && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(chars[i + 1]) > -1) {
if (chars[i] == COLOR_CHAR && "x0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(chars[i + 1]) > -1) {
chars[i] = TRANSLATED_CHAR;
chars[i + 1] = Character.toLowerCase(chars[i + 1]);
}