Fix rare exception when attempting to show effect over killed NPC

This commit is contained in:
PikaMug 2019-11-27 02:17:31 -05:00
parent 065c3f0b8e
commit e03a7ea171

View File

@ -61,6 +61,9 @@ public class NpcEffectThread implements Runnable {
* @param effectType Value of EnumParticle such as NOTE or SMOKE * @param effectType Value of EnumParticle such as NOTE or SMOKE
*/ */
public void showEffect(Player player, NPC npc, String effectType) { public void showEffect(Player player, NPC npc, String effectType) {
if (player == null || npc == null) {
return;
}
if (plugin.getDependencies().getCitizens() != null) { if (plugin.getDependencies().getCitizens() != null) {
Location eyeLoc = npc.getEntity().getLocation(); Location eyeLoc = npc.getEntity().getLocation();
eyeLoc.setY(eyeLoc.getY() + 1.5); eyeLoc.setY(eyeLoc.getY() + 1.5);