1
0
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:
Zrips 2017-01-13 17:34:22 +02:00
parent 9a5863c7f0
commit 86e55de3b1

View File

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