mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
@@ -103,6 +103,16 @@ public enum ChatColor {
|
|||||||
return colors.get(code);
|
return colors.get(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Strips the given message of all color codes
|
||||||
|
*
|
||||||
|
* @param input String to strip of color
|
||||||
|
* @return A copy of the input string, without any coloring
|
||||||
|
*/
|
||||||
|
public static String stripColor(final String input) {
|
||||||
|
return input.replaceAll("(?i)\u00A7[0-F]", "");
|
||||||
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (ChatColor color : ChatColor.values()) {
|
for (ChatColor color : ChatColor.values()) {
|
||||||
colors.put(color.getCode(), color);
|
colors.put(color.getCode(), color);
|
||||||
|
Reference in New Issue
Block a user