NullPointerException Fix for no null check on custom mob name.

This commit is contained in:
sigonasr2 2014-02-16 02:00:47 -07:00
parent e4bfcc023a
commit abada6ded4

View File

@ -2341,7 +2341,7 @@ public void runTick() {
}
if (nearby.get(i).getType()==EntityType.ZOMBIE) {
Creature l = (Creature)nearby.get(i);
if (l.getCustomName().compareTo(ChatColor.GOLD+"Charge Zombie II")==0 && !l.isDead() && l.getKiller()!=null) {
if (l.getCustomName()!=null && l.getCustomName().compareTo(ChatColor.GOLD+"Charge Zombie II")==0 && !l.isDead() && l.getKiller()!=null) {
for (int k=-2;k<3;k++) {
for (int j=-2;j<3;j++) {
Location checkloc = l.getLocation().add(k,1,j);
@ -2362,7 +2362,7 @@ public void runTick() {
}
}
}
if (l.getCustomName().compareTo(ChatColor.YELLOW+"Charge Zombie")==0 && !l.isDead() && l.getKiller()!=null) {
if (l.getCustomName()!=null && l.getCustomName().compareTo(ChatColor.YELLOW+"Charge Zombie")==0 && !l.isDead() && l.getKiller()!=null) {
for (int k=-1;k<2;k++) {
for (int j=-1;j<2;j++) {
Location checkloc = l.getLocation().add(k,1,j);