Convert between spigot colorcodes and my own...

This commit is contained in:
libraryaddict
2022-01-30 11:55:52 +13:00
parent 7dffc92365
commit 88d9b081fa
4 changed files with 19 additions and 4 deletions

View File

@@ -289,7 +289,15 @@ public class DisguiseUtilities {
name = team.getPrefix() + team.getColor() + player.getName() + team.getSuffix();
}
return name.replaceAll("§x§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])", "<#$1$2$3$4$5$6>");
return getHexedColors(name);
}
public static String getHexedColors(String string) {
if (string == null) {
return string;
}
return string.replaceAll("§x§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])§([0-9a-fA-F])", "<#$1$2$3$4$5$6>");
}
public static String getDisplayName(String playerName) {