mirror of
https://github.com/darksaid98/nightcore-spigot.git
synced 2026-12-04 14:38:46 +00:00
legacy colors fix
This commit is contained in:
1 parent
64bf57fb8f
commit
5ad34d5749
1 file changed
+4
@@ -117,8 +117,12 @@ public class NightMessage {
|
|||||||
public static BaseComponent[] parse(@NotNull String string, @NotNull TagPool tagPool) {
|
public static BaseComponent[] parse(@NotNull String string, @NotNull TagPool tagPool) {
|
||||||
if (CoreConfig.LEGACY_COLOR_SUPPORT.get()) {
|
if (CoreConfig.LEGACY_COLOR_SUPPORT.get()) {
|
||||||
TimedMatcher timedMatcher = TimedMatcher.create(Colorizer.PATTERN_HEX_LEGACY, string);
|
TimedMatcher timedMatcher = TimedMatcher.create(Colorizer.PATTERN_HEX_LEGACY, string);
|
||||||
|
Set<String> rawCodes = new HashSet<>();
|
||||||
while (timedMatcher.find()) {
|
while (timedMatcher.find()) {
|
||||||
String hex = timedMatcher.getMatcher().group(1);
|
String hex = timedMatcher.getMatcher().group(1);
|
||||||
|
rawCodes.add(hex);
|
||||||
|
}
|
||||||
|
for (String hex : rawCodes) {
|
||||||
string = string.replace(hex, Tag.brackets(hex));
|
string = string.replace(hex, Tag.brackets(hex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user