Make the regex case insensitive

This commit is contained in:
Focusvity 2023-09-25 16:23:22 +10:00
parent dfeaf2033d
commit d806ad56f2
No known key found for this signature in database
GPG Key ID: 85AD157561ABE94B

View File

@ -980,11 +980,11 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
private Component colorize(String string) private Component colorize(String string)
{ {
Matcher matcher = Pattern.compile("&[a-fk-or0-9]").matcher(string); Matcher matcher = Pattern.compile("&[a-fk-or0-9]", Pattern.CASE_INSENSITIVE).matcher(string);
while (matcher.find()) while (matcher.find())
{ {
String color = matcher.group(); String color = matcher.group();
string = string.replace(color, COLOR_TRANSLATION.getOrDefault(color, color)); string = string.replace(color, COLOR_TRANSLATION.getOrDefault(color.toLowerCase(), color));
} }
return mm.deserialize(string); return mm.deserialize(string);
} }