mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
check for Damageable instance before doing stuff
This commit is contained in:
parent
9a5863c7f0
commit
86e55de3b1
@ -774,6 +774,8 @@ public class JobsPaymentListener implements Listener {
|
||||
if (!(damager instanceof Player))
|
||||
return;
|
||||
double damage = event.getFinalDamage();
|
||||
if (!(ent instanceof Damageable))
|
||||
return;
|
||||
double s = ((Damageable) ent).getHealth();
|
||||
if (damage > s)
|
||||
damage = s;
|
||||
@ -795,6 +797,8 @@ public class JobsPaymentListener implements Listener {
|
||||
ProjectileSource shooter = projectile.getShooter();
|
||||
double damage = event.getFinalDamage();
|
||||
|
||||
if (!(ent instanceof Damageable))
|
||||
return;
|
||||
double s = ((Damageable) ent).getHealth();
|
||||
|
||||
if (damage > s)
|
||||
|
Loading…
Reference in New Issue
Block a user