1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-30 21:07:48 +01:00

Merge pull request #1707 from Jsinco/master

Check if killer is a projectile shot by a player
This commit is contained in:
Zrips 2024-01-25 13:00:14 +02:00 committed by GitHub
commit 757d621e0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);