Apply poison mechanics to all mobs as well.
This commit is contained in:
parent
1b217b968d
commit
f2e426f69b
Binary file not shown.
@ -2724,15 +2724,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e instanceof Player) {
|
if (e instanceof LivingEntity) {
|
||||||
log("Damage reason is "+ev.getCause().toString(),4);
|
LivingEntity l = (LivingEntity)e;
|
||||||
final Player p = (Player)e;
|
|
||||||
|
|
||||||
int poisonlv = 0;
|
int poisonlv = 0;
|
||||||
if (p.hasPotionEffect(PotionEffectType.POISON)) {
|
if (l.hasPotionEffect(PotionEffectType.POISON)) {
|
||||||
for (int j=0;j<p.getActivePotionEffects().size();j++) {
|
for (int j=0;j<l.getActivePotionEffects().size();j++) {
|
||||||
if (Iterables.get(p.getActivePotionEffects(), j).getType().equals(PotionEffectType.POISON)) {
|
if (Iterables.get(l.getActivePotionEffects(), j).getType().equals(PotionEffectType.POISON)) {
|
||||||
poisonlv = Iterables.get(p.getActivePotionEffects(), j).getAmplifier()+1;
|
poisonlv = Iterables.get(l.getActivePotionEffects(), j).getAmplifier()+1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2741,6 +2740,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
log("New damage set to "+ev.getDamage()+" from Poison "+poisonlv,3);
|
log("New damage set to "+ev.getDamage()+" from Poison "+poisonlv,3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e instanceof Player) {
|
||||||
|
log("Damage reason is "+ev.getCause().toString(),4);
|
||||||
|
final Player p = (Player)e;
|
||||||
|
|
||||||
if (ev.getCause()==DamageCause.ENTITY_EXPLOSION ||
|
if (ev.getCause()==DamageCause.ENTITY_EXPLOSION ||
|
||||||
ev.getCause()==DamageCause.BLOCK_EXPLOSION) {
|
ev.getCause()==DamageCause.BLOCK_EXPLOSION) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user