From adf2fbb6408aa0a32ce964c44d84a4bbd11a5909 Mon Sep 17 00:00:00 2001 From: Jsinco Date: Wed, 17 Jan 2024 02:46:02 -0500 Subject: [PATCH] Check if killer is a projectile shot by a player --- .../com/gamingmesh/jobs/listeners/JobsPaymentListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index a6eb10b7..ba9f6224 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -1370,6 +1370,10 @@ public final class JobsPaymentListener implements Listener { if (killer instanceof Player) { // Checking if killer is player pDamager = (Player) killer; + } else if (killer instanceof Projectile) { // Checking if killer is a projectile shot by a player + Projectile projectile = (Projectile) killer; + + pDamager = projectile.getShooter() instanceof Player ? (Player) projectile.getShooter() : null; } else if (isMyPet) { // Checking if killer is MyPet animal UUID uuid = HookManager.getMyPetManager().getOwnerOfPet(killer);