// Path: src/main/java/de/ntcomputer/minecraft/controllablemobs/implementation/ControllableMobHelper.java
// public class ControllableMobHelper {
// 	
// 	@SuppressWarnings("deprecation")
// 	public static Class<? extends net.minecraft.server.v1_7_R1.Entity> getNmsEntityClass(final Class<? extends LivingEntity> entityClass) throws IllegalArgumentException {
// 		if(entityClass==null) throw new IllegalArgumentException("entityClass must not be null");
// 		if(entityClass==HumanEntity.class || entityClass==Player.class) return net.minecraft.server.v1_7_R1.EntityHuman.class;
// 		if(entityClass==Monster.class) return net.minecraft.server.v1_7_R1.EntityMonster.class;
// 		if(entityClass==Creature.class) return net.minecraft.server.v1_7_R1.EntityCreature.class;
// 		if(entityClass==Animals.class) return net.minecraft.server.v1_7_R1.EntityAnimal.class;
// 		if(entityClass==LivingEntity.class) return net.minecraft.server.v1_7_R1.EntityLiving.class;
// 		
// 		for(EntityType entityType: EntityType.values()) {
// 			if(entityType.getEntityClass()==null || entityType.getTypeId()==-1) continue;
// 			if(entityClass.equals(entityType.getEntityClass())) {
// 				return getNmsEntityClass(entityType);
// 			}
// 		}
// 		
// 		throw new IllegalArgumentException("Class "+entityClass.getSimpleName()+" is not resolvable to an EntityType");
// 	}
// 	
// 	@SuppressWarnings("deprecation")
// 	public static Class<? extends net.minecraft.server.v1_7_R1.Entity> getNmsEntityClass(final EntityType entityType) throws IllegalArgumentException {
// 		if(entityType==null) throw new IllegalArgumentException("EntityType must not be null");
// 		if(entityType==EntityType.PLAYER) return net.minecraft.server.v1_7_R1.EntityHuman.class;
// 		
// 		try {
// 			final Class<? extends net.minecraft.server.v1_7_R1.Entity> entityClass = NativeInterfaces.ENTITYTYPES.METHOD_GETCLASSBYID.invoke(entityType.getTypeId());
// 			if(entityClass==null) throw new IllegalArgumentException("EntityType "+entityType+" is not resolvable to a net.minecraft Class");
// 			return entityClass;
// 		} catch(Exception e) {
// 			throw new IllegalArgumentException("EntityType "+entityType+" is not resolvable to a net.minecraft Class", e);
// 		}
// 	}
// 
// }


import net.minecraft.server.v1_7_R1.EntityLiving;
import org.bukkit.entity.LivingEntity;
import de.ntcomputer.minecraft.controllablemobs.implementation.ControllableMobHelper;

package de.ntcomputer.minecraft.controllablemobs.api.ai.behaviors;




/**
 * Base class for target behavior with extended arguments.
 * Implementation of these behaviors are using a custom core.
 * 
 * @author Cybran
 * @version 53
 *
 */
public abstract class AITargetBehaviorEx extends AITargetBehavior<LivingEntity> {
	protected final int maximumNoEyeContactTicks;
	protected final boolean ignoreInvulnerability;
	protected final double maximumDistance;
	protected final Class<? extends EntityLiving>[] targetClasses;

	@SuppressWarnings("unchecked")
	protected AITargetBehaviorEx(int priority, int maximumNoEyeContactTicks, boolean ignoreInvulnerability, double maximumDistance, Class<? extends LivingEntity>[] targetClasses) throws IllegalArgumentException {
		super(priority);
		if(targetClasses==null) throw new IllegalArgumentException("targetClasses must not be null");
		if(targetClasses.length==0) throw new IllegalArgumentException("targetClasses must not be empty");
		this.maximumNoEyeContactTicks = maximumNoEyeContactTicks;
		this.ignoreInvulnerability = ignoreInvulnerability;
		this.maximumDistance = maximumDistance;
		this.targetClasses = new Class[targetClasses.length];
		for(int i=0; i<targetClasses.length; i++) {

// Path: src/main/java/de/ntcomputer/minecraft/controllablemobs/implementation/ControllableMobHelper.java
// public class ControllableMobHelper {
// 	
// 	@SuppressWarnings("deprecation")
// 	public static Class<? extends net.minecraft.server.v1_7_R1.Entity> getNmsEntityClass(final Class<? extends LivingEntity> entityClass) throws IllegalArgumentException {
// 		if(entityClass==null) throw new IllegalArgumentException("entityClass must not be null");
// 		if(entityClass==HumanEntity.class || entityClass==Player.class) return net.minecraft.server.v1_7_R1.EntityHuman.class;
// 		if(entityClass==Monster.class) return net.minecraft.server.v1_7_R1.EntityMonster.class;
// 		if(entityClass==Creature.class) return net.minecraft.server.v1_7_R1.EntityCreature.class;
// 		if(entityClass==Animals.class) return net.minecraft.server.v1_7_R1.EntityAnimal.class;
// 		if(entityClass==LivingEntity.class) return net.minecraft.server.v1_7_R1.EntityLiving.class;
// 		
// 		for(EntityType entityType: EntityType.values()) {
// 			if(entityType.getEntityClass()==null || entityType.getTypeId()==-1) continue;
// 			if(entityClass.equals(entityType.getEntityClass())) {
// 				return getNmsEntityClass(entityType);
// 			}
// 		}
// 		
// 		throw new IllegalArgumentException("Class "+entityClass.getSimpleName()+" is not resolvable to an EntityType");
// 	}
// 	
// 	@SuppressWarnings("deprecation")
// 	public static Class<? extends net.minecraft.server.v1_7_R1.Entity> getNmsEntityClass(final EntityType entityType) throws IllegalArgumentException {
// 		if(entityType==null) throw new IllegalArgumentException("EntityType must not be null");
// 		if(entityType==EntityType.PLAYER) return net.minecraft.server.v1_7_R1.EntityHuman.class;
// 		
// 		try {
// 			final Class<? extends net.minecraft.server.v1_7_R1.Entity> entityClass = NativeInterfaces.ENTITYTYPES.METHOD_GETCLASSBYID.invoke(entityType.getTypeId());
// 			if(entityClass==null) throw new IllegalArgumentException("EntityType "+entityType+" is not resolvable to a net.minecraft Class");
// 			return entityClass;
// 		} catch(Exception e) {
// 			throw new IllegalArgumentException("EntityType "+entityType+" is not resolvable to a net.minecraft Class", e);
// 		}
// 	}
// 
// }


// Path: src/main/java/de/ntcomputer/minecraft/controllablemobs/api/ai/behaviors/AITargetBehaviorEx.java
import net.minecraft.server.v1_7_R1.EntityLiving;
import org.bukkit.entity.LivingEntity;
import de.ntcomputer.minecraft.controllablemobs.implementation.ControllableMobHelper;

package de.ntcomputer.minecraft.controllablemobs.api.ai.behaviors;




/**
 * Base class for target behavior with extended arguments.
 * Implementation of these behaviors are using a custom core.
 * 
 * @author Cybran
 * @version 53
 *
 */
public abstract class AITargetBehaviorEx extends AITargetBehavior<LivingEntity> {
	protected final int maximumNoEyeContactTicks;
	protected final boolean ignoreInvulnerability;
	protected final double maximumDistance;
	protected final Class<? extends EntityLiving>[] targetClasses;

	@SuppressWarnings("unchecked")
	protected AITargetBehaviorEx(int priority, int maximumNoEyeContactTicks, boolean ignoreInvulnerability, double maximumDistance, Class<? extends LivingEntity>[] targetClasses) throws IllegalArgumentException {
		super(priority);
		if(targetClasses==null) throw new IllegalArgumentException("targetClasses must not be null");
		if(targetClasses.length==0) throw new IllegalArgumentException("targetClasses must not be empty");
		this.maximumNoEyeContactTicks = maximumNoEyeContactTicks;
		this.ignoreInvulnerability = ignoreInvulnerability;
		this.maximumDistance = maximumDistance;
		this.targetClasses = new Class[targetClasses.length];
		for(int i=0; i<targetClasses.length; i++) {

			this.targetClasses[i] = (Class<? extends EntityLiving>) ControllableMobHelper.getNmsEntityClass(targetClasses[i]);
