// 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 DummyCore.Utils.MathUtils;
import DummyCore.Utils.MiscUtils;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import tb.utils.TBUtils;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.items.wands.ItemWand;
        j += (int)(f1 * 15.0F * 16.0F);

        if (j > 240)
        {
            j = 240;
        }

        return j | k << 16;
    }
    
    public void onUpdate()
    {
        super.onUpdate();

        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
        this.motionY -= 0.029999999329447746D;

        if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava)
        {
            this.motionY = 0.20000000298023224D;
            this.motionX = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F;
            this.motionZ = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F;
            this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
        }

        this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ);
        double d0 = 8.0D;

// 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/entity/EntityAspectOrb.java
import DummyCore.Utils.MathUtils;
import DummyCore.Utils.MiscUtils;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import tb.utils.TBUtils;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.items.wands.ItemWand;

        j += (int)(f1 * 15.0F * 16.0F);

        if (j > 240)
        {
            j = 240;
        }

        return j | k << 16;
    }
    
    public void onUpdate()
    {
        super.onUpdate();

        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
        this.motionY -= 0.029999999329447746D;

        if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() == Material.lava)
        {
            this.motionY = 0.20000000298023224D;
            this.motionX = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F;
            this.motionZ = (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F;
            this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F);
        }

        this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ);
        double d0 = 8.0D;

        EntityPlayer player = (EntityPlayer) MiscUtils.getClosestEntity(TBUtils.castLst(this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.fromBounds(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ).expand(8, 8, 8))), posX, posY, posZ);