mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +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)
|
public static String colorize(String string)
|
||||||
{
|
{
|
||||||
Matcher matcher = Pattern.compile("&#[a-f0-9A-F]{6}").matcher(string);
|
if (string != null)
|
||||||
while (matcher.find())
|
|
||||||
{
|
{
|
||||||
String code = matcher.group().replace("&", "");
|
Matcher matcher = Pattern.compile("&#[a-f0-9A-F]{6}").matcher(string);
|
||||||
string = string.replace("&" + code, net.md_5.bungee.api.ChatColor.of(code) + "");
|
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;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user