From d806ad56f2e80eb72cacb6024316ce38e4e3a1d6 Mon Sep 17 00:00:00 2001 From: Focusvity Date: Mon, 25 Sep 2023 16:23:22 +1000 Subject: [PATCH] Make the regex case insensitive --- src/main/java/dev/plex/itemizerx/ItemizerXCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/plex/itemizerx/ItemizerXCommand.java b/src/main/java/dev/plex/itemizerx/ItemizerXCommand.java index 7f336de..8e661eb 100644 --- a/src/main/java/dev/plex/itemizerx/ItemizerXCommand.java +++ b/src/main/java/dev/plex/itemizerx/ItemizerXCommand.java @@ -980,11 +980,11 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase 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()) { 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); }