This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ColorOptimizer { | |
/** | |
* Matches text until next color code. | |
* &a&lSome&b&oText -> &a&lSome, &b&oText | |
*/ | |
private static final Pattern SPLIT_PATTERN = Pattern.compile("(" + ChatColor.COLOR_CHAR + "[0-9A-Fa-fK-Ok-oRr])+(.*?)(?=(?:" + ChatColor.COLOR_CHAR + "[0-9A-Fa-fK-Ok-oRr])|$)"); | |
/** | |
* Matches any color. | |
*/ | |
private static final Pattern COLOR = Pattern.compile("(" + ChatColor.COLOR_CHAR + "[0-9A-Fa-f])"); |