Fix item builder to properly use null item titles

This commit is contained in:
AlexTheCoder 2017-05-04 20:46:38 -04:00
parent 455e09a9da
commit 00d31ffad3

View File

@ -400,9 +400,14 @@ public class ItemBuilder
public ItemBuilder setTitle(String title)
{
_title = (title == null ? null
: (title.length() > 2 && ChatColor.getLastColors(title.substring(0, 2)).length() == 0 ? ChatColor.WHITE : ""))
+ title;
if (title == null)
{
_title = null;
}
else
{
_title = ((title.length() > 2 && ChatColor.getLastColors(title.substring(0, 2)).length() == 0) ? ChatColor.WHITE : "") + title;
}
return this;
}