// Path: java/tb/utils/TBUtils.java
// public class TBUtils {
// 	
// 	public static ArrayList<Pair<Integer,Coord3D>> loadedClientSpawners = new ArrayList<Pair<Integer,Coord3D>>();
// 	
// 	public static Coord3D getClosestLoadedClientSpawner(EntityPlayer player)
// 	{
// 		if(player == null)
// 			return null;
// 		
// 		if(player instanceof FakePlayer)
// 			return null;
// 		
// 		if(player.worldObj == null)
// 			return null;
// 		
// 		if(!player.worldObj.isRemote)
// 			return null;
// 		
// 		double closestDistance = Short.MAX_VALUE;
// 		int index = -1;
// 		
// 		for(Pair<Integer,Coord3D> p : loadedClientSpawners)
// 		{
// 			if(p.getFirst() != player.dimension)
// 				continue;
// 			
// 			double distance = Math.sqrt(player.getDistance(p.getSecond().x, p.getSecond().y, p.getSecond().z));
// 			if(distance < closestDistance)
// 			{
// 				closestDistance = distance;
// 				index = loadedClientSpawners.indexOf(p);
// 			}
// 		}
// 		
// 		if(index != -1)
// 			return loadedClientSpawners.get(index).getSecond();
// 		
// 		return null;
// 	}
// 	
// 	/**
// 	 * @param type 0 = Temporary, 1 = Regular, 2 = Permanent
// 	 */
// 	public static void addWarpToPlayer(EntityPlayer addTo, int amount, int type)
// 	{
// 		switch(type)
// 		{
// 			case 2:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.PERMANENT);
// 				return;
// 			}
// 			case 1:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.NORMAL);
// 				return;
// 			}
// 			case 0:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.TEMPORARY);
// 				return;
// 			}
// 			default:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.NORMAL);
// 				return;
// 			}
// 		}
// 	}
// 	
// 	public static List<Entity> castLst(List<? extends Entity> l)
// 	{
// 		List<Entity> retLst = new ArrayList<Entity>();
// 		
// 		for(Object e : l)
// 			retLst.add((Entity) e);
// 		
// 		return retLst;
// 	}
// 
// }


import java.util.List;
import DummyCore.Client.Icon;
import DummyCore.Client.IconRegister;
import DummyCore.Utils.IOldItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import tb.utils.TBUtils;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
	@SideOnly(Side.CLIENT)
    public void getSubItems(Item itm, CreativeTabs tab, List lst)
    {
    	for(int i = 0; i < names.length; ++i)
    		lst.add(new ItemStack(itm,1,i));
    }
    
    public ItemStack onItemRightClick(ItemStack stk, World w, EntityPlayer player)
    {
    	int meta = stk.getItemDamage();
    	if(!player.worldObj.isRemote)
	    	if(meta < 7)
	    	{
	    		for(int i = 0; i < addedAspects[meta].size(); ++i)
	    		{
	    			EntityXPOrb xp = new EntityXPOrb(w,player.posX,player.posY,player.posZ,2);
	    			w.spawnEntityInWorld(xp);
	    		}
	    	}else
	    	{
	    		//if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), "TB.TaintMinor"))
	    		//	PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("@TB.TaintMinor"), (EntityPlayerMP)player);
	    		int overhaulAddedAspects = 0;
	    		for(int i = 0; i < Aspect.getCompoundAspects().size(); ++i)
	    		{
	    			Aspect a = Aspect.getCompoundAspects().get(i);
	    			if(a == Aspect.FLUX)
	    			{
		    			EntityXPOrb xp = new EntityXPOrb(w,player.posX,player.posY,player.posZ,16);
		    			w.spawnEntityInWorld(xp);
// Path: java/tb/utils/TBUtils.java
// public class TBUtils {
// 	
// 	public static ArrayList<Pair<Integer,Coord3D>> loadedClientSpawners = new ArrayList<Pair<Integer,Coord3D>>();
// 	
// 	public static Coord3D getClosestLoadedClientSpawner(EntityPlayer player)
// 	{
// 		if(player == null)
// 			return null;
// 		
// 		if(player instanceof FakePlayer)
// 			return null;
// 		
// 		if(player.worldObj == null)
// 			return null;
// 		
// 		if(!player.worldObj.isRemote)
// 			return null;
// 		
// 		double closestDistance = Short.MAX_VALUE;
// 		int index = -1;
// 		
// 		for(Pair<Integer,Coord3D> p : loadedClientSpawners)
// 		{
// 			if(p.getFirst() != player.dimension)
// 				continue;
// 			
// 			double distance = Math.sqrt(player.getDistance(p.getSecond().x, p.getSecond().y, p.getSecond().z));
// 			if(distance < closestDistance)
// 			{
// 				closestDistance = distance;
// 				index = loadedClientSpawners.indexOf(p);
// 			}
// 		}
// 		
// 		if(index != -1)
// 			return loadedClientSpawners.get(index).getSecond();
// 		
// 		return null;
// 	}
// 	
// 	/**
// 	 * @param type 0 = Temporary, 1 = Regular, 2 = Permanent
// 	 */
// 	public static void addWarpToPlayer(EntityPlayer addTo, int amount, int type)
// 	{
// 		switch(type)
// 		{
// 			case 2:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.PERMANENT);
// 				return;
// 			}
// 			case 1:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.NORMAL);
// 				return;
// 			}
// 			case 0:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.TEMPORARY);
// 				return;
// 			}
// 			default:
// 			{
// 				ResearchHelper.addWarpToPlayer(addTo, amount, EnumWarpType.NORMAL);
// 				return;
// 			}
// 		}
// 	}
// 	
// 	public static List<Entity> castLst(List<? extends Entity> l)
// 	{
// 		List<Entity> retLst = new ArrayList<Entity>();
// 		
// 		for(Object e : l)
// 			retLst.add((Entity) e);
// 		
// 		return retLst;
// 	}
// 
// }


// Path: java/tb/common/item/ItemKnoseFragment.java
import java.util.List;
import DummyCore.Client.Icon;
import DummyCore.Client.IconRegister;
import DummyCore.Utils.IOldItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import tb.utils.TBUtils;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;

	@SideOnly(Side.CLIENT)
    public void getSubItems(Item itm, CreativeTabs tab, List lst)
    {
    	for(int i = 0; i < names.length; ++i)
    		lst.add(new ItemStack(itm,1,i));
    }
    
    public ItemStack onItemRightClick(ItemStack stk, World w, EntityPlayer player)
    {
    	int meta = stk.getItemDamage();
    	if(!player.worldObj.isRemote)
	    	if(meta < 7)
	    	{
	    		for(int i = 0; i < addedAspects[meta].size(); ++i)
	    		{
	    			EntityXPOrb xp = new EntityXPOrb(w,player.posX,player.posY,player.posZ,2);
	    			w.spawnEntityInWorld(xp);
	    		}
	    	}else
	    	{
	    		//if(!ResearchManager.isResearchComplete(player.getCommandSenderName(), "TB.TaintMinor"))
	    		//	PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("@TB.TaintMinor"), (EntityPlayerMP)player);
	    		int overhaulAddedAspects = 0;
	    		for(int i = 0; i < Aspect.getCompoundAspects().size(); ++i)
	    		{
	    			Aspect a = Aspect.getCompoundAspects().get(i);
	    			if(a == Aspect.FLUX)
	    			{
		    			EntityXPOrb xp = new EntityXPOrb(w,player.posX,player.posY,player.posZ,16);
		    			w.spawnEntityInWorld(xp);
	    				TBUtils.addWarpToPlayer(player, 2, 0);