Don't counter-attack non-LivingEntity

Closes #100
Closes #107
This commit is contained in:
NuclearW 2012-02-05 15:07:35 -05:00
parent 0b30920edd
commit 598c507849

View File

@ -17,7 +17,6 @@
package com.gmail.nossr50.skills;
import org.bukkit.ChatColor;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@ -175,11 +174,11 @@ public class Swords
public static void counterAttackChecks(EntityDamageByEntityEvent event)
{
//Don't want to counter attack arrows
//Don't want to counter attack stuff not alive
if(event.getDamager() instanceof Arrow)
if(!(event.getDamager() instanceof LivingEntity))
return;
if(event instanceof EntityDamageByEntityEvent)
{
Entity f = ((EntityDamageByEntityEvent) event).getDamager();