// Path: java/tb/common/entity/EntityAIAvoidCampfire.java
// public class EntityAIAvoidCampfire extends EntityAIBase
// {
// 	public boolean isScared;
// 	public int scareTimer;
// 	public int campfireX;
// 	public int campfireY;
// 	public int campfireZ;
// 	public World worldObj;
// 	public EntityCreature entityObj;
//     /** The PathEntity of our entity */
//     private PathEntity entityPathEntity;
//     /** The PathNavigate of our entity */
//     private PathNavigate entityPathNavigate;
//     private double farSpeed;
//     private double nearSpeed;
// 
// 	public EntityAIAvoidCampfire(EntityCreature creature)
// 	{
// 		scareTimer = 100;
// 		worldObj = creature.worldObj;
// 		entityObj = creature;
// 		this.setMutexBits(1);
// 		this.entityPathNavigate = creature.getNavigator();
// 		nearSpeed = 2;
// 		farSpeed = nearSpeed*2;
// 	}
// 	
// 	@Override
// 	public boolean shouldExecute()
// 	{
// 		if(isScared)
// 		{
// 			Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.entityObj, 16, 10, new Vec3(campfireX+0.5D, campfireY+0.0D, campfireZ+0.5D));
// 			
// 			if(vec3 == null)
// 				return false;
// 			
//             this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord);
//             return this.entityPathEntity == null ? false : this.entityPathEntity.isDestinationSame(vec3);
// 		}
// 		return false;
// 	}
// 	
//     public boolean continueExecuting()
//     {
//         return !this.entityObj.getNavigator().noPath() && scareTimer > 0;
//     }
//     
//     public void resetTask()
//     {
//     }
//     
//     public void updateTask()
//     {
//     	if(entityPathNavigate != null && (entityPathNavigate.getPath() == null || entityPathNavigate.getPath() != entityPathEntity))
//     	{
//     		this.entityPathNavigate.setPath(this.entityPathEntity, nearSpeed);
//     	}
//     	
//     	--scareTimer;
//     	if(scareTimer <= 0)
//     		isScared = false;
//     	
//         if (this.entityObj.getDistanceSq(campfireX+0.5D,campfireY,campfireZ+0.5D) < 49.0D)
//         {
//             this.entityObj.getNavigator().setSpeed(this.nearSpeed);
//         }
//         else
//         {
//             this.entityObj.getNavigator().setSpeed(this.farSpeed);
//         }
//     }
//     
//     public void startExecuting()
//     {
//     	this.entityPathNavigate.setPath(this.entityPathEntity, nearSpeed);
//     }
// 
// }


import java.util.ArrayList;
import java.util.List;
import DummyCore.Utils.BlockStateMetadata;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.ai.EntityAITasks;
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
import net.minecraft.entity.monster.IMob;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ITickable;
import net.minecraft.world.World;
import tb.common.entity.EntityAIAvoidCampfire;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.events.EssentiaHandler;
			{
				burnTime = 1600;
				this.worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).getBlock().getStateFromMeta(1));
			}
		}
		
		if(!this.worldObj.isRemote)
		{
			if(burnTime <= 0)
			{
				int metadata = BlockStateMetadata.getBlockMetadata(worldObj, pos);
				if(metadata == 1)
					this.worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).getBlock().getStateFromMeta(0));
				
				return;
			}
		}

		
		if(!this.worldObj.isRemote)
		{
			List<EntityCreature> creatures = this.worldObj.getEntitiesWithinAABB(EntityCreature.class, AxisAlignedBB.fromBounds(pos.getX(), pos.getY(), pos.getZ(), pos.getX()+1, pos.getY()+1, pos.getZ()+1).expand(12, 6, 12));
			
			for(EntityCreature c : creatures)
			{
				if(!(c instanceof IMob))
					continue;

			      ArrayList entries = (ArrayList) c.tasks.taskEntries;
			      
// Path: java/tb/common/entity/EntityAIAvoidCampfire.java
// public class EntityAIAvoidCampfire extends EntityAIBase
// {
// 	public boolean isScared;
// 	public int scareTimer;
// 	public int campfireX;
// 	public int campfireY;
// 	public int campfireZ;
// 	public World worldObj;
// 	public EntityCreature entityObj;
//     /** The PathEntity of our entity */
//     private PathEntity entityPathEntity;
//     /** The PathNavigate of our entity */
//     private PathNavigate entityPathNavigate;
//     private double farSpeed;
//     private double nearSpeed;
// 
// 	public EntityAIAvoidCampfire(EntityCreature creature)
// 	{
// 		scareTimer = 100;
// 		worldObj = creature.worldObj;
// 		entityObj = creature;
// 		this.setMutexBits(1);
// 		this.entityPathNavigate = creature.getNavigator();
// 		nearSpeed = 2;
// 		farSpeed = nearSpeed*2;
// 	}
// 	
// 	@Override
// 	public boolean shouldExecute()
// 	{
// 		if(isScared)
// 		{
// 			Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.entityObj, 16, 10, new Vec3(campfireX+0.5D, campfireY+0.0D, campfireZ+0.5D));
// 			
// 			if(vec3 == null)
// 				return false;
// 			
//             this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord);
//             return this.entityPathEntity == null ? false : this.entityPathEntity.isDestinationSame(vec3);
// 		}
// 		return false;
// 	}
// 	
//     public boolean continueExecuting()
//     {
//         return !this.entityObj.getNavigator().noPath() && scareTimer > 0;
//     }
//     
//     public void resetTask()
//     {
//     }
//     
//     public void updateTask()
//     {
//     	if(entityPathNavigate != null && (entityPathNavigate.getPath() == null || entityPathNavigate.getPath() != entityPathEntity))
//     	{
//     		this.entityPathNavigate.setPath(this.entityPathEntity, nearSpeed);
//     	}
//     	
//     	--scareTimer;
//     	if(scareTimer <= 0)
//     		isScared = false;
//     	
//         if (this.entityObj.getDistanceSq(campfireX+0.5D,campfireY,campfireZ+0.5D) < 49.0D)
//         {
//             this.entityObj.getNavigator().setSpeed(this.nearSpeed);
//         }
//         else
//         {
//             this.entityObj.getNavigator().setSpeed(this.farSpeed);
//         }
//     }
//     
//     public void startExecuting()
//     {
//     	this.entityPathNavigate.setPath(this.entityPathEntity, nearSpeed);
//     }
// 
// }


// Path: java/tb/common/tile/TileBraizer.java
import java.util.ArrayList;
import java.util.List;
import DummyCore.Utils.BlockStateMetadata;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.ai.EntityAITasks;
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
import net.minecraft.entity.monster.IMob;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ITickable;
import net.minecraft.world.World;
import tb.common.entity.EntityAIAvoidCampfire;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.lib.events.EssentiaHandler;

			{
				burnTime = 1600;
				this.worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).getBlock().getStateFromMeta(1));
			}
		}
		
		if(!this.worldObj.isRemote)
		{
			if(burnTime <= 0)
			{
				int metadata = BlockStateMetadata.getBlockMetadata(worldObj, pos);
				if(metadata == 1)
					this.worldObj.setBlockState(getPos(), worldObj.getBlockState(getPos()).getBlock().getStateFromMeta(0));
				
				return;
			}
		}

		
		if(!this.worldObj.isRemote)
		{
			List<EntityCreature> creatures = this.worldObj.getEntitiesWithinAABB(EntityCreature.class, AxisAlignedBB.fromBounds(pos.getX(), pos.getY(), pos.getZ(), pos.getX()+1, pos.getY()+1, pos.getZ()+1).expand(12, 6, 12));
			
			for(EntityCreature c : creatures)
			{
				if(!(c instanceof IMob))
					continue;

			      ArrayList entries = (ArrayList) c.tasks.taskEntries;
			      
			      EntityAIAvoidCampfire campfireAviodable = null;