Open Pieter12345 opened 11 months ago
You're using a non-capturing parentheses group, so we get this:
java.lang.IndexOutOfBoundsException: No group 2
at java.base/java.util.regex.Matcher.group(Matcher.java:646)
at com.laytonsmith.core.Static.lambda$MCToANSIColors$0(Static.java:1188)
at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1256)
at com.laytonsmith.core.Static.MCToANSIColors(Static.java:1187)
You're using a non-capturing parentheses group, so we get this:
java.lang.IndexOutOfBoundsException: No group 2 at java.base/java.util.regex.Matcher.group(Matcher.java:646) at com.laytonsmith.core.Static.lambda$MCToANSIColors$0(Static.java:1188) at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1256) at com.laytonsmith.core.Static.MCToANSIColors(Static.java:1187)
I'm not using a non-capturing parenthesis group (see inner part of (?i)§x(?:§([a-f0-9])){6}
), but it appears that it only matches the last out of the 6 matches. I will explode it into (?i)§x§([a-f0-9])§([a-f0-9])§([a-f0-9])§([a-f0-9])§([a-f0-9])§([a-f0-9])
.
This adds conversion from MC RGB colors to ANSI color codes. The catch is that Windows command prompt does not show these colors, so it might still make sense to convert these to the nearest available ANSI colors. If you use Linux or Mac OS, could you test whether RGB color codes now work in cmdline mode and leave a comment with the result? Thanks!