From d6939b79163914c28347ebd7ff7fa4d8501888fd Mon Sep 17 00:00:00 2001 From: Dark Arc Date: Wed, 2 Jan 2013 19:38:27 -0500 Subject: [PATCH] Allow EnderPearls to damage the player who threw them in no-pvp areas --- .../com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java index 46407492..a026934e 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardEntityListener.java @@ -30,6 +30,7 @@ import org.bukkit.entity.Creature; import org.bukkit.entity.Creeper; import org.bukkit.entity.EnderDragon; +import org.bukkit.entity.EnderPearl; import org.bukkit.entity.Enderman; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -379,6 +380,7 @@ private void onEntityDamageByProjectile(EntityDamageByEntityEvent event) { // Check Player // if (event.getDamager() instanceof EnderPearl || event.getDamager() instanceof Snowball) return; if (attacker != null && attacker instanceof Player) { + if (event.getDamager() instanceof EnderPearl && attacker == player) return; if (wcfg.useRegions) { Vector pt = toVector(defender.getLocation()); Vector pt2 = toVector(attacker.getLocation());