File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
src/main/java/dev/espi/protectionstones Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -516,21 +516,14 @@ private static void messageUpgrades(PSL psl, YamlConfiguration yml) {
516
516
}
517
517
}
518
518
519
- // match all %#123abc#% format for hex
520
- private static final Pattern hexPatternLong = Pattern .compile ("(?<!\\ \\ \\ \\ )(%#[a-fA-F0-9]{8}%)" ),
521
- hexPatternShort = Pattern .compile ("(?<!\\ \\ \\ \\ )(%#[a-fA-F0-9]{6}%)" );
519
+ // match all {abc format for hex
520
+ private static final Pattern hexPattern = Pattern .compile ("(?<!\\ \\ \\ \\ )(&#[a-fA-F0-9]{6})" );
522
521
523
522
private static String applyInGameColours (String msg ) {
524
523
525
- Matcher matcher = hexPatternLong .matcher (msg );
524
+ Matcher matcher = hexPattern .matcher (msg );
526
525
while (matcher .find ()) {
527
- String color = msg .substring (matcher .start () + 1 , matcher .end () - 1 );
528
- msg = msg .replace (msg .substring (matcher .start (), matcher .end ()), "" + net .md_5 .bungee .api .ChatColor .of (color ));
529
- }
530
-
531
- matcher = hexPatternShort .matcher (msg );
532
- while (matcher .find ()) {
533
- String color = msg .substring (matcher .start () + 1 , matcher .end () - 1 );
526
+ String color = msg .substring (matcher .start () + 1 , matcher .end ());
534
527
msg = msg .replace (msg .substring (matcher .start (), matcher .end ()), "" + net .md_5 .bungee .api .ChatColor .of (color ));
535
528
}
536
529
You can’t perform that action at this time.
0 commit comments