Allow EnderPearls to damage the player who threw them in no-pvp areas

This commit is contained in:
Dark Arc 2013-01-02 19:38:27 -05:00 committed by Wizjany
parent 5f0ca37879
commit d6939b7916

View File

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