44import com .jcdesimp .landlord .persistantData .OwnedLand ;
55import org .bukkit .ChatColor ;
66import org .bukkit .Material ;
7+ import org .bukkit .entity .EntityType ;
8+ import org .bukkit .entity .Ocelot ;
79import org .bukkit .entity .Player ;
810import org .bukkit .entity .Projectile ;
911import org .bukkit .event .EventHandler ;
1012import org .bukkit .event .EventPriority ;
1113import org .bukkit .event .entity .EntityDamageByEntityEvent ;
1214import org .bukkit .inventory .ItemStack ;
1315
16+ import javax .swing .text .html .parser .Entity ;
1417import java .util .Arrays ;
1518
1619/**
@@ -74,9 +77,11 @@ public HarmAnimals() {
7477
7578 @ EventHandler (priority = EventPriority .HIGH )
7679 public void animalDamage (EntityDamageByEntityEvent event ){
77- String [] safeAnimals = {"OCELOT" ,"WOLF" ,"HORSE" ,"COW" ,"PIG" ,"MUSHROOM_COW" ,"SHEEP" ,"CHICKEN" };
80+ //String[] ssafeAnimals = {"OCELOT","WOLF","HORSE","COW","PIG","MUSHROOM_COW","SHEEP","CHICKEN"};
81+ EntityType [] safeAnimals = {EntityType .OCELOT , EntityType .WOLF , EntityType .HORSE , EntityType .COW , EntityType .PIG ,
82+ EntityType .MUSHROOM_COW , EntityType .SHEEP , EntityType .CHICKEN , EntityType .RABBIT };
7883 org .bukkit .entity .Entity victim = event .getEntity ();
79- if (!Arrays .asList (safeAnimals ).contains (victim .getType (). toString () )){
84+ if (!Arrays .asList (safeAnimals ).contains (victim .getType ())){
8085 return ;
8186 }
8287
@@ -91,7 +96,7 @@ public void animalDamage(EntityDamageByEntityEvent event){
9196 }
9297 if (!land .hasPermTo (p , this )){
9398
94- p .sendMessage (ChatColor .RED +"You cannot harm animals on this land." );
99+ p .sendMessage (ChatColor .RED +"You cannot harm animals on this land." );
95100
96101 event .setCancelled (true );
97102
0 commit comments