1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-16 20:31:25 +01:00

Merge pull request #1803 from mikyvars/master

Add gain exp by returning a fireball from a ghast
This commit is contained in:
Zrips 2024-08-15 13:36:15 +03:00 committed by GitHub
commit adb92ff2a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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