add null check for entity death event for statistics

This commit is contained in:
PhanaticD 2019-01-09 12:50:38 -05:00
parent e7f2d5ce5d
commit eb9fc7ca37

View file

@ -629,10 +629,13 @@ public class PKListener implements Listener {
}
}.runTaskLater(ProjectKorra.plugin, 20);
}
StatisticsMethods.addStatisticAbility(event.getAttacker().getUniqueId(), CoreAbility.getAbility(event.getAbility().getName()), com.projectkorra.projectkorra.util.Statistic.PLAYER_KILLS, 1);
if (event.getAttacker() != null) {
StatisticsMethods.addStatisticAbility(event.getAttacker().getUniqueId(), CoreAbility.getAbility(event.getAbility().getName()), com.projectkorra.projectkorra.util.Statistic.PLAYER_KILLS, 1);
}
}
if (event.getAttacker() != null) {
StatisticsMethods.addStatisticAbility(event.getAttacker().getUniqueId(), CoreAbility.getAbility(event.getAbility().getName()), com.projectkorra.projectkorra.util.Statistic.TOTAL_KILLS, 1);
}
StatisticsMethods.addStatisticAbility(event.getAttacker().getUniqueId(), CoreAbility.getAbility(event.getAbility().getName()), com.projectkorra.projectkorra.util.Statistic.TOTAL_KILLS, 1);
}
@EventHandler