net.minecraft.pathfinding.PathNavigateGround Java Examples

The following examples show how to use net.minecraft.pathfinding.PathNavigateGround. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityBear.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
public EntityBear(World worldIn) 
{
	super(worldIn);
	this.setSize(1.5F, 1.7F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISmartSwim(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIHerdMove(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWanderHex(this, 0.5D));
	this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(9, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
	setBearType(BearType.values()[worldIn.rand.nextInt(3)]);
}
 
Example #2
Source File: EntityBoar.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
public EntityBoar(World worldIn) 
{
	super(worldIn);
	this.setSize(1.0F, 1.0F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
	setBoarStage(worldIn.rand.nextBoolean() ? BoarStage.Black : BoarStage.Brown);
}
 
Example #3
Source File: EntityElk.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
public EntityElk(World worldIn) 
{
	super(worldIn);
	this.setSize(1.5F, 1.8F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISmartSwim(this));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));	
	aiHerdMove = new EntityAIHerdMove(this, 0.5D);
	this.tasks.addTask(6, aiHerdMove);
	this.tasks.addTask(7, new EntityAIWanderHex(this, 0.5D));
	//this.tasks.addTask(7, new EntityAIWander(this, 0.5D));
	//this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #4
Source File: EntityElephant.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
public EntityElephant(World worldIn) 
{
	super(worldIn);
	this.setSize(1.8F, 2.5F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
	setElephantType(ElephantType.Elephant);
}
 
Example #5
Source File: EntityTiger.java    From TFC2 with GNU General Public License v3.0 6 votes vote down vote up
public EntityTiger(World worldIn) 
{
	super(worldIn);
	this.setSize(1.5F, 1.7F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
	setTigerType(worldIn.rand.nextBoolean() ? TigerType.Normal : TigerType.Snow);
}
 
Example #6
Source File: EntityAIFollowPlayer.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
public EntityAIFollowPlayer(EntityLiving entity, double followSpeedIn, float minDistIn, float maxDistIn) {
	this.entity = entity;
	this.world = entity.world;
	this.followSpeed = followSpeedIn;
	this.petPathfinder = entity.getNavigator();
	this.minDist = minDistIn;
	this.maxDist = maxDistIn;
	this.setMutexBits(3);

	UUID exclude = entity.getEntityData().getUniqueId("owner");
	if (exclude != null) {
		EntityPlayer owner = world.getPlayerEntityByUUID(exclude);
		if (owner != null) {
			this.owner = owner;
		}
	}

	if (!(entity.getNavigator() instanceof PathNavigateGround)) {
		throw new IllegalArgumentException("Unsupported mob type for FollowOwnerGoal");
	}
}
 
Example #7
Source File: EntityGnomeWood.java    From CommunityMod with GNU Lesser General Public License v2.1 6 votes vote down vote up
public EntityGnomeWood(World par1World)
{
	super(par1World);

       this.setSize(0.6F, 0.8F);
       //this.getNavigator().setAvoidsWater(true);
       ((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
       this.tasks.addTask(0, new EntityAISwimming(this));
       //this.tasks.addTask(1, new EntityAIPanicToHome(this, 1.5D));
       //this.tasks.addTask(1, new EntityAIFleeFrom(this, 1.25D));
       //this.tasks.addTask(2, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.5D));
       this.tasks.addTask(3, new EntityAICreateGnomeCache(this, 1.0));
       //this.tasks.addTask(4, new EntityAIPerformGnomeAssignment(this, 1.0));
       this.tasks.addTask(5, new EntityAIPerformJob(this));
       this.tasks.addTask(6, new EntityAIOpenDoor(this, true));
       //this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
      // this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
       //this.tasks.addTask(9, new EntityAILookIdle(this));
       
       this.gnode = null;
       this.panic = false;
       //this.hasChest = false;
}
 
Example #8
Source File: EntityRhino.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityRhino(World worldIn) 
{
	super(worldIn);
	this.setSize(1.5F, 1.7F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #9
Source File: EntityHippo.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityHippo(World worldIn) 
{
	super(worldIn);
	this.setSize(1.8F, 2.0F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #10
Source File: EntityTofunian.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public EntityTofunian(World worldIn) {
    super(worldIn);
    this.villagerInventory = new InventoryBasic("Items", false, 8);
    this.setSize(0.45F, 1.4F);
    ((PathNavigateGround) this.getNavigator()).setBreakDoors(true);
    this.setCanPickUpLoot(true);
}
 
Example #11
Source File: EntityMoby.java    From mobycraft with Apache License 2.0 5 votes vote down vote up
public EntityMoby(World worldIn)
{
    super(worldIn);
    this.setSize(1.8F, 1.3F);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(false);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
    this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(3, new EntityAITempt(this, 1.25D, Items.fish, false));
    this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
    this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
}
 
Example #12
Source File: EntityLion.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityLion(World worldIn) 
{
	super(worldIn);
	this.setSize(1.5F, 1.7F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #13
Source File: EntityHamster.java    From Hyperium with GNU Lesser General Public License v3.0 5 votes vote down vote up
public EntityHamster(World worldIn) {
    super(worldIn);
    setSize(0.4F, 0.2F);
    ((PathNavigateGround) getNavigator()).setAvoidsWater(true);
    tasks.addTask(1, new EntityAIFollowOwner(this, 1f, 10f, 2f));
    tasks.addTask(2, new EntityAIWander(this, 1));
    tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayerSP.class, 8f));
    tasks.addTask(3, new EntityAILookIdle(this));
    setTamed(true);
    preventEntitySpawning = false;
}
 
Example #14
Source File: EntityMammoth.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityMammoth(World worldIn) 
{
	super(worldIn);
	this.setSize(1.8F, 2.5F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #15
Source File: EntityBigCat.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityBigCat(World worldIn) 
{
	super(worldIn);
	this.setSize(1.5F, 1.7F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #16
Source File: EntityFoxRed.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityFoxRed(World worldIn) 
{
	super(worldIn);
	this.setSize(0.4F, 0.5F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #17
Source File: EntityBison.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
public EntityBison(World worldIn) 
{
	super(worldIn);
	this.setSize(1.8F, 2.5F);
	((PathNavigateGround)this.getNavigator()).setCanSwim(true);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(2, new EntityAIMate(this, 0.8D));
	this.tasks.addTask(4, new EntityAIAttackMelee(this, 0.8D, true));
	this.tasks.addTask(5, new EntityAIFollowParent(this, 0.8D));		
	this.tasks.addTask(6, new EntityAIWander(this, 0.5D));
	this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
	this.tasks.addTask(8, new EntityAILookIdle(this));
	this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true, new Class[0]));//The array seems to be for class types that this task should ignore
	setGender(worldIn.rand.nextBoolean() ? Gender.Male : Gender.Female);
}
 
Example #18
Source File: EntityAITemptAndExplode.java    From CommunityMod with GNU Lesser General Public License v2.1 5 votes vote down vote up
public EntityAITemptAndExplode(EntityExplodingChicken temptedEntityIn, double speedIn, boolean scaredByPlayerMovementIn, Set<Item> temptItemIn)
{
    this.temptedEntity = temptedEntityIn;
    this.speed = speedIn;
    this.temptItem = temptItemIn;
    this.scaredByPlayerMovement = scaredByPlayerMovementIn;
    this.setMutexBits(3);

    if (!(temptedEntityIn.getNavigator() instanceof PathNavigateGround))
    {
        throw new IllegalArgumentException("Unsupported mob type for TemptGoal");
    }
}
 
Example #19
Source File: EntityAISmartSwim.java    From TFC2 with GNU General Public License v3.0 4 votes vote down vote up
public EntityAISmartSwim(EntityLiving entitylivingIn)
{
	this.theEntity = entitylivingIn;
	this.setMutexBits(4);
	((PathNavigateGround)entitylivingIn.getNavigator()).setCanSwim(true);
}