Merge pull request #20 from ediTv2/1.6.x
Fix for Issue #6 (Arrow Entity Damage)
This commit is contained in:
commit
8e1cd1f004
@ -254,7 +254,6 @@ public class FactionsEntityListener implements Listener {
|
|||||||
public boolean canDamagerHurtDamagee(EntityDamageByEntityEvent sub, boolean notify) {
|
public boolean canDamagerHurtDamagee(EntityDamageByEntityEvent sub, boolean notify) {
|
||||||
Entity damager = sub.getDamager();
|
Entity damager = sub.getDamager();
|
||||||
Entity damagee = sub.getEntity();
|
Entity damagee = sub.getEntity();
|
||||||
ProjectileSource shooter = null;
|
|
||||||
double damage = sub.getDamage();
|
double damage = sub.getDamage();
|
||||||
|
|
||||||
if (!(damagee instanceof Player))
|
if (!(damagee instanceof Player))
|
||||||
@ -270,10 +269,10 @@ public class FactionsEntityListener implements Listener {
|
|||||||
|
|
||||||
// for damage caused by projectiles, getDamager() returns the projectile... what we need to know is the source
|
// for damage caused by projectiles, getDamager() returns the projectile... what we need to know is the source
|
||||||
if (damager instanceof Projectile) {
|
if (damager instanceof Projectile) {
|
||||||
shooter = ((Projectile) damager).getShooter();
|
damager = (Entity) ((Projectile) damager).getShooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shooter != null && shooter == damagee) // ender pearl usage and other self-inflicted damage
|
if (damager == damagee) // ender pearl usage and other self-inflicted damage
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Players can not take attack damage in a SafeZone, or possibly peaceful territory
|
// Players can not take attack damage in a SafeZone, or possibly peaceful territory
|
||||||
|
Loading…
Reference in New Issue
Block a user