From 834d807b22b8b27932d5c3bcd1e65182eb91f7b5 Mon Sep 17 00:00:00 2001 From: mikyvars Date: Wed, 14 Aug 2024 19:53:45 +0200 Subject: [PATCH] feat: Add gain exp by returning a fireball from a ghast --- .../java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 4cc43fbd..5c85f9cd 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -1306,6 +1306,8 @@ public final class JobsPaymentListener implements Listener { if (!(event.getEntity().getLastDamageCause() instanceof EntityDamageByEntityEvent)) { killer = entityLastDamager.getIfPresent(event.getEntity().getUniqueId()); + } else if(event.getEntity().getLastDamageCause().getCause() == EntityDamageEvent.DamageCause.PROJECTILE) { + killer = event.getEntity().getLastDamageCause().getDamageSource().getCausingEntity(); } else { killer = ((EntityDamageByEntityEvent) event.getEntity().getLastDamageCause()).getDamager(); }