Fixed IndexOutOfBoundsException

This commit is contained in:
jack lin 2014-08-20 19:40:07 +12:00
parent 15440a84e4
commit e1f03e1c3f

View file

@ -19,7 +19,7 @@ public class TagAPIListener implements Listener {
public void onNameTag(AsyncPlayerReceiveNameTagEvent e) {
List<Element> elements = Methods.getBendingPlayer(e.getNamedPlayer().getName()).getElements();
if (elements!=null && plugin.getConfig().getBoolean("Properties.TagAPI.Enabled")) {
if (elements.size() > 1)
if (elements.size() < 1)
e.setTag(ChatColor.LIGHT_PURPLE + e.getNamedPlayer().getName());
else if (elements.get(0).equals(Element.Earth))
e.setTag(ChatColor.GREEN + e.getNamedPlayer().getName());