当前位置: 首页>>代码示例>>Java>>正文


Java PathNavigateGround类代码示例

本文整理汇总了Java中net.minecraft.pathfinding.PathNavigateGround的典型用法代码示例。如果您正苦于以下问题:Java PathNavigateGround类的具体用法?Java PathNavigateGround怎么用?Java PathNavigateGround使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PathNavigateGround类属于net.minecraft.pathfinding包,在下文中一共展示了PathNavigateGround类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: EntityOcelot

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityOcelot(World worldIn)
{
    super(worldIn);
    this.setSize(0.6F, 0.7F);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
    this.tasks.addTask(6, new EntityAIOcelotSit(this, 0.8D));
    this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
    this.tasks.addTask(8, new EntityAIOcelotAttack(this));
    this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
    this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, false, (Predicate)null));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:EntityOcelot.java

示例2: EntityHorse

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityHorse(World worldIn)
{
    super(worldIn);
    this.setSize(1.4F, 1.6F);
    this.isImmuneToFire = false;
    this.setChested(false);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 1.2D));
    this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D));
    this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(4, new EntityAIFollowParent(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWander(this, 0.7D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.initHorseChest();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntityHorse.java

示例3: EntityPig

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityPig(World worldIn)
{
    super(worldIn);
    this.setSize(0.9F, 0.9F);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
    this.tasks.addTask(2, this.aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.3F));
    this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot_on_a_stick, false));
    this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.carrot, false));
    this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
    this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:EntityPig.java

示例4: EntityIronGolem

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityIronGolem(World worldIn)
{
    super(worldIn);
    this.setSize(1.4F, 2.9F);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true));
    this.tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 0.9D, 32.0F));
    this.tasks.addTask(3, new EntityAIMoveThroughVillage(this, 0.6D, true));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(5, new EntityAILookAtVillager(this));
    this.tasks.addTask(6, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIDefendVillage(this));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(3, new EntityIronGolem.AINearestAttackableTargetNonCreeper(this, EntityLiving.class, 10, false, true, IMob.VISIBLE_MOB_SELECTOR));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntityIronGolem.java

示例5: EntityRabbit

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityRabbit(World worldIn)
{
    super(worldIn);
    this.setSize(0.6F, 0.7F);
    this.jumpHelper = new EntityRabbit.RabbitJumpHelper(this);
    this.moveHelper = new EntityRabbit.RabbitMoveHelper(this);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.navigator.setHeightRequirement(2.5F);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityRabbit.AIPanic(this, 1.33D));
    this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.carrot, false));
    this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Items.golden_carrot, false));
    this.tasks.addTask(2, new EntityAITempt(this, 1.0D, Item.getItemFromBlock(Blocks.yellow_flower), false));
    this.tasks.addTask(3, new EntityAIMate(this, 0.8D));
    this.tasks.addTask(5, new EntityRabbit.AIRaidFarm(this));
    this.tasks.addTask(5, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    this.aiAvoidWolves = new EntityRabbit.AIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D);
    this.tasks.addTask(4, this.aiAvoidWolves);
    this.setMovementSpeed(0.0D);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:EntityRabbit.java

示例6: EntitySheep

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntitySheep(World worldIn)
{
    super(worldIn);
    this.setSize(0.9F, 1.3F);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
    this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(3, new EntityAITempt(this, 1.1D, Items.wheat, false));
    this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D));
    this.tasks.addTask(5, this.entityAIEatGrass);
    this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
    this.inventoryCrafting.setInventorySlotContents(0, new ItemStack(Items.dye, 1, 0));
    this.inventoryCrafting.setInventorySlotContents(1, new ItemStack(Items.dye, 1, 0));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntitySheep.java

示例7: EntityVillager

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityVillager(World worldIn, int professionId)
{
    super(worldIn);
    this.villagerInventory = new InventoryBasic("Items", false, 8);
    this.setProfession(professionId);
    this.setSize(0.6F, 1.8F);
    ((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
    ((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
    this.tasks.addTask(1, new EntityAITradePlayer(this));
    this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
    this.tasks.addTask(2, new EntityAIMoveIndoors(this));
    this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
    this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
    this.tasks.addTask(6, new EntityAIVillagerMate(this));
    this.tasks.addTask(7, new EntityAIFollowGolem(this));
    this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(9, new EntityAIVillagerInteract(this));
    this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
    this.setCanPickUpLoot(true);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:EntityVillager.java

示例8: setBreakDoorsAItask

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
/**
 * Sets or removes EntityAIBreakDoor task
 */
public void setBreakDoorsAItask(boolean enabled)
{
    if (this.isBreakDoorsTaskSet != enabled)
    {
        this.isBreakDoorsTaskSet = enabled;
        ((PathNavigateGround)this.getNavigator()).setBreakDoors(enabled);

        if (enabled)
        {
            this.tasks.addTask(1, this.breakDoor);
        }
        else
        {
            this.tasks.removeTask(this.breakDoor);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:EntityZombie.java

示例9: EntityAITempt

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityAITempt(EntityCreature temptedEntityIn, double speedIn, Item temptItemIn, boolean scaredByPlayerMovementIn)
{
    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");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:EntityAITempt.java

示例10: startExecuting

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
/**
 * Execute a one shot task or start executing a continuous task
 */
public void startExecuting()
{
    this.targetX = this.temptingPlayer.posX;
    this.targetY = this.temptingPlayer.posY;
    this.targetZ = this.temptingPlayer.posZ;
    this.isRunning = true;
    this.avoidWater = ((PathNavigateGround)this.temptedEntity.getNavigator()).getAvoidsWater();
    ((PathNavigateGround)this.temptedEntity.getNavigator()).setAvoidsWater(false);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:EntityAITempt.java

示例11: EntityWither

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityWither(World worldIn)
{
    super(worldIn);
    this.setHealth(this.getMaxHealth());
    this.setSize(0.9F, 3.5F);
    this.isImmuneToFire = true;
    ((PathNavigateGround)this.getNavigator()).setCanSwim(true);
    this.experienceValue = 50;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:EntityWither.java

示例12: EntityAIDoorInteract

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityAIDoorInteract(EntityLiving entityIn)
{
    this.theEntity = entityIn;

    if (!(entityIn.getNavigator() instanceof PathNavigateGround))
    {
        throw new IllegalArgumentException("Unsupported mob type for DoorInteractGoal");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:EntityAIDoorInteract.java

示例13: startExecuting

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
/**
 * Execute a one shot task or start executing a continuous task
 */
public void startExecuting()
{
    this.field_75343_h = 0;
    this.field_75344_i = ((PathNavigateGround)this.thePet.getNavigator()).getAvoidsWater();
    ((PathNavigateGround)this.thePet.getNavigator()).setAvoidsWater(false);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:EntityAIFollowOwner.java

示例14: resetTask

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
/**
 * Resets the task
 */
public void resetTask()
{
    ((PathNavigateGround)this.entityObj.getNavigator()).setBreakDoors(true);
    ((PathNavigateGround)this.entityObj.getNavigator()).setEnterDoors(true);
    this.frontDoor = null;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:EntityAIRestrictOpenDoor.java

示例15: EntityAIFollowOwner

import net.minecraft.pathfinding.PathNavigateGround; //导入依赖的package包/类
public EntityAIFollowOwner(EntityTameable thePetIn, double followSpeedIn, float minDistIn, float maxDistIn)
{
    this.thePet = thePetIn;
    this.theWorld = thePetIn.worldObj;
    this.followSpeed = followSpeedIn;
    this.petPathfinder = thePetIn.getNavigator();
    this.minDist = minDistIn;
    this.maxDist = maxDistIn;
    this.setMutexBits(3);

    if (!(thePetIn.getNavigator() instanceof PathNavigateGround))
    {
        throw new IllegalArgumentException("Unsupported mob type for FollowOwnerGoal");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:EntityAIFollowOwner.java


注:本文中的net.minecraft.pathfinding.PathNavigateGround类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。