// Path: src/main/java/de/ntcomputer/minecraft/controllablemobs/implementation/nativeinterfaces/NativeInterfaces.java
// public final class NativeInterfaces {
// 	public static final NmsControllerJump CONTROLLERJUMP = new NmsControllerJump();
// 	public static final NmsControllerLook CONTROLLERLOOK = new NmsControllerLook();
// 	public static final NmsEntity ENTITY = new NmsEntity();
// 	public static final CBInterfaceJavaPluginLoader JAVAPLUGINLOADER = new CBInterfaceJavaPluginLoader();
// 	public static final NmsNavigation NAVIGATION = new NmsNavigation();
// 	public static final NmsInterfacePathfinderGoal PATHFINDERGOAL = new NmsInterfacePathfinderGoal();
// 	public static final NmsPathfinderGoalSelector PATHFINDERGOALSELECTOR = new NmsPathfinderGoalSelector();
// 	public static final NmsPathfinderGoalSelectorItem PATHFINDERGOALSELECTORITEM = new NmsPathfinderGoalSelectorItem();
// 	public static final CBInterfacePluginClassLoader PLUGINCLASSLOADER = new CBInterfacePluginClassLoader();
// 	public static final NmsWorld WORLD = new NmsWorld();
// 	public static final NmsIAttribute IATTRIBUTE = new NmsIAttribute();
// 	public static final NmsAttributeRanged ATTRIBUTERANGED = new NmsAttributeRanged();
// 	public static final NmsAttributeModifiable ATTRIBUTEMODIFIABLE = new NmsAttributeModifiable();
// 	public static final NmsAttributeModifier ATTRIBUTEMODIFIER = new NmsAttributeModifier();
// 	public static final NmsGenericAttributes GENERICATTRIBUTES = new NmsGenericAttributes();
// 	public static final NmsEntityInsentient ENTITYINSENTIENT = new NmsEntityInsentient();
// 	public static final NmsEntityTypes ENTITYTYPES = new NmsEntityTypes();
// 	
// 	private NativeInterfaces() {
// 		throw new AssertionError();
// 	}
// 
// }


import org.bukkit.entity.Animals;
import org.bukkit.entity.Creature;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces;

package de.ntcomputer.minecraft.controllablemobs.implementation;



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 {

// Path: src/main/java/de/ntcomputer/minecraft/controllablemobs/implementation/nativeinterfaces/NativeInterfaces.java
// public final class NativeInterfaces {
// 	public static final NmsControllerJump CONTROLLERJUMP = new NmsControllerJump();
// 	public static final NmsControllerLook CONTROLLERLOOK = new NmsControllerLook();
// 	public static final NmsEntity ENTITY = new NmsEntity();
// 	public static final CBInterfaceJavaPluginLoader JAVAPLUGINLOADER = new CBInterfaceJavaPluginLoader();
// 	public static final NmsNavigation NAVIGATION = new NmsNavigation();
// 	public static final NmsInterfacePathfinderGoal PATHFINDERGOAL = new NmsInterfacePathfinderGoal();
// 	public static final NmsPathfinderGoalSelector PATHFINDERGOALSELECTOR = new NmsPathfinderGoalSelector();
// 	public static final NmsPathfinderGoalSelectorItem PATHFINDERGOALSELECTORITEM = new NmsPathfinderGoalSelectorItem();
// 	public static final CBInterfacePluginClassLoader PLUGINCLASSLOADER = new CBInterfacePluginClassLoader();
// 	public static final NmsWorld WORLD = new NmsWorld();
// 	public static final NmsIAttribute IATTRIBUTE = new NmsIAttribute();
// 	public static final NmsAttributeRanged ATTRIBUTERANGED = new NmsAttributeRanged();
// 	public static final NmsAttributeModifiable ATTRIBUTEMODIFIABLE = new NmsAttributeModifiable();
// 	public static final NmsAttributeModifier ATTRIBUTEMODIFIER = new NmsAttributeModifier();
// 	public static final NmsGenericAttributes GENERICATTRIBUTES = new NmsGenericAttributes();
// 	public static final NmsEntityInsentient ENTITYINSENTIENT = new NmsEntityInsentient();
// 	public static final NmsEntityTypes ENTITYTYPES = new NmsEntityTypes();
// 	
// 	private NativeInterfaces() {
// 		throw new AssertionError();
// 	}
// 
// }


// Path: src/main/java/de/ntcomputer/minecraft/controllablemobs/implementation/ControllableMobHelper.java
import org.bukkit.entity.Animals;
import org.bukkit.entity.Creature;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces;

package de.ntcomputer.minecraft.controllablemobs.implementation;



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