Closed tgxn closed 12 years ago
Can you make it so we can colour the broadcasts please? if you want a function to do this, this is what i use in my plugins to colourise text with &a, &b etc:
public static String convertColors(String str) { Pattern color_codes = Pattern.compile("&([0-9A-Fa-fkKLlOoMmNn])"); Matcher find_colors = color_codes.matcher(str); while (find_colors.find()) { str = find_colors.replaceFirst(new StringBuilder().append(ChatColor.COLOR_CHAR).append(find_colors.group(1)).toString()); find_colors = color_codes.matcher(str); } return str; }
I understood this was already implemented, but I will review the code and check.
This is already in the plugin?
Functionality is as described in: http://www.minecraftwiki.net/wiki/Formatting_codes Closing ticket.
Can you make it so we can colour the broadcasts please? if you want a function to do this, this is what i use in my plugins to colourise text with &a, &b etc:
public static String convertColors(String str) { Pattern color_codes = Pattern.compile("&([0-9A-Fa-fkKLlOoMmNn])"); Matcher find_colors = color_codes.matcher(str); while (find_colors.find()) { str = find_colors.replaceFirst(new StringBuilder().append(ChatColor.COLOR_CHAR).append(find_colors.group(1)).toString()); find_colors = color_codes.matcher(str); } return str; }