// 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 java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import net.minecraft.server.v1_7_R1.AttributeModifiable;
import net.minecraft.server.v1_7_R1.AttributeRanged;
import de.ntcomputer.minecraft.controllablemobs.api.attributes.Attribute;
import de.ntcomputer.minecraft.controllablemobs.api.attributes.AttributeModifier;
import de.ntcomputer.minecraft.controllablemobs.api.attributes.ModifyOperation;
import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces;

package de.ntcomputer.minecraft.controllablemobs.implementation.attributes;



public final class CraftAttribute implements Attribute {
	private static final Set<CraftAttribute> attributes = new HashSet<CraftAttribute>();
	private static final Map<UUID,CraftAttributeModifier> modifierMap = new HashMap<UUID,CraftAttributeModifier>();
	private AttributeModifiable nativeAttribute;
	private AttributeRanged nativeAttributeTemplate;
	private final double defaultBasisValue;
	
	public static void registerCustomModifier(CraftAttributeModifier modifier) {
		modifierMap.put(modifier.getUniqueID(), modifier);
		for(CraftAttribute attribute: attributes) {
			if(attribute.hasModifierAttached(modifier)) {
				modifier.setAttributeAttached(attribute);
			}
		}
	}
	
	public CraftAttribute(AttributeModifiable nativeAttribute) {
		this.nativeAttribute = nativeAttribute;

// 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/attributes/CraftAttribute.java
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import net.minecraft.server.v1_7_R1.AttributeModifiable;
import net.minecraft.server.v1_7_R1.AttributeRanged;
import de.ntcomputer.minecraft.controllablemobs.api.attributes.Attribute;
import de.ntcomputer.minecraft.controllablemobs.api.attributes.AttributeModifier;
import de.ntcomputer.minecraft.controllablemobs.api.attributes.ModifyOperation;
import de.ntcomputer.minecraft.controllablemobs.implementation.nativeinterfaces.NativeInterfaces;

package de.ntcomputer.minecraft.controllablemobs.implementation.attributes;



public final class CraftAttribute implements Attribute {
	private static final Set<CraftAttribute> attributes = new HashSet<CraftAttribute>();
	private static final Map<UUID,CraftAttributeModifier> modifierMap = new HashMap<UUID,CraftAttributeModifier>();
	private AttributeModifiable nativeAttribute;
	private AttributeRanged nativeAttributeTemplate;
	private final double defaultBasisValue;
	
	public static void registerCustomModifier(CraftAttributeModifier modifier) {
		modifierMap.put(modifier.getUniqueID(), modifier);
		for(CraftAttribute attribute: attributes) {
			if(attribute.hasModifierAttached(modifier)) {
				modifier.setAttributeAttached(attribute);
			}
		}
	}
	
	public CraftAttribute(AttributeModifiable nativeAttribute) {
		this.nativeAttribute = nativeAttribute;

		this.nativeAttributeTemplate = (AttributeRanged) NativeInterfaces.ATTRIBUTEMODIFIABLE.METHOD_GETATTRIBUTETEMPLATE.invoke(nativeAttribute);
