mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-27 20:27:37 +00:00
fix npe in /myinfo
This commit is contained in:
parent
4f276ec78e
commit
588a2f1eba
@ -591,14 +591,17 @@ public class FUtil
|
||||
|
||||
public static String colorize(String string)
|
||||
{
|
||||
Matcher matcher = Pattern.compile("&#[a-f0-9A-F]{6}").matcher(string);
|
||||
while (matcher.find())
|
||||
if (string != null)
|
||||
{
|
||||
String code = matcher.group().replace("&", "");
|
||||
string = string.replace("&" + code, net.md_5.bungee.api.ChatColor.of(code) + "");
|
||||
}
|
||||
Matcher matcher = Pattern.compile("&#[a-f0-9A-F]{6}").matcher(string);
|
||||
while (matcher.find())
|
||||
{
|
||||
String code = matcher.group().replace("&", "");
|
||||
string = string.replace("&" + code, net.md_5.bungee.api.ChatColor.of(code) + "");
|
||||
}
|
||||
|
||||
string = ChatColor.translateAlternateColorCodes('&', string);
|
||||
string = ChatColor.translateAlternateColorCodes('&', string);
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user