Java 类net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer 实例源码

项目:enderutilities    文件:EntityUtils.java   
/**
 * Removes the (last found) dummy blocker AI task, if any
 * @param tasks
 */
public static void removeDummyAIBlockerTask(EntityAITasks tasks)
{
    EntityAIBase task = null;

    for (EntityAITaskEntry taskEntry : tasks.taskEntries)
    {
        if (taskEntry.action instanceof EntityAIDummyBlockerTask)
        {
            task = taskEntry.action;
        }

        // Restore the default mutex bits.
        // TODO: If modded mob tasks use this bit, then we should store the original value so we can restore it.
        if (taskEntry.action instanceof EntityAIFindEntityNearestPlayer)
        {
            taskEntry.action.setMutexBits(taskEntry.action.getMutexBits() & 0x7F);
        }
    }

    if (task != null)
    {
        tasks.removeTask(task);
    }
}
项目:HeroUtils    文件:EntityDummy.java   
protected void initEntityAI()
{
    this.tasks.addTask(5, new AIRandomFly(this));
    this.tasks.addTask(7, new AILookAround(this));
    this.tasks.addTask(7, new AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:DecompiledMinecraft    文件:EntityGhast.java   
public EntityGhast(World worldIn)
{
    super(worldIn);
    this.setSize(4.0F, 4.0F);
    this.isImmuneToFire = true;
    this.experienceValue = 5;
    this.moveHelper = new EntityGhast.GhastMoveHelper(this);
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:DecompiledMinecraft    文件:EntitySlime.java   
public EntitySlime(World worldIn)
{
    super(worldIn);
    this.moveHelper = new EntitySlime.SlimeMoveHelper(this);
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:DecompiledMinecraft    文件:EntityGhast.java   
public EntityGhast(World worldIn)
{
    super(worldIn);
    this.setSize(4.0F, 4.0F);
    this.isImmuneToFire = true;
    this.experienceValue = 5;
    this.moveHelper = new EntityGhast.GhastMoveHelper(this);
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:DecompiledMinecraft    文件:EntitySlime.java   
public EntitySlime(World worldIn)
{
    super(worldIn);
    this.moveHelper = new EntitySlime.SlimeMoveHelper(this);
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:BaseClient    文件:EntityGhast.java   
public EntityGhast(World worldIn)
{
    super(worldIn);
    this.setSize(4.0F, 4.0F);
    this.isImmuneToFire = true;
    this.experienceValue = 5;
    this.moveHelper = new EntityGhast.GhastMoveHelper(this);
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:BaseClient    文件:EntitySlime.java   
public EntitySlime(World worldIn)
{
    super(worldIn);
    this.moveHelper = new EntitySlime.SlimeMoveHelper(this);
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:BaseClient    文件:EntityGhast.java   
public EntityGhast(World worldIn)
{
    super(worldIn);
    this.setSize(4.0F, 4.0F);
    this.isImmuneToFire = true;
    this.experienceValue = 5;
    this.moveHelper = new EntityGhast.GhastMoveHelper(this);
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:BaseClient    文件:EntitySlime.java   
public EntitySlime(World worldIn)
{
    super(worldIn);
    this.moveHelper = new EntitySlime.SlimeMoveHelper(this);
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:Backmemed    文件:EntityGhast.java   
protected void initEntityAI()
{
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:Backmemed    文件:EntitySlime.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:CustomWorldGen    文件:EntityGhast.java   
protected void initEntityAI()
{
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:CustomWorldGen    文件:EntitySlime.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:Aether-Legacy    文件:EntitySentry.java   
@Override
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntitySentry.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySentry.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySentry.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySentry.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:ExpandedRailsMod    文件:EntityGhast.java   
protected void initEntityAI()
{
    this.tasks.addTask(5, new EntityGhast.AIRandomFly(this));
    this.tasks.addTask(7, new EntityGhast.AILookAround(this));
    this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
}
项目:ExpandedRailsMod    文件:EntitySlime.java   
protected void initEntityAI()
{
    this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this));
    this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this));
    this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this));
    this.tasks.addTask(5, new EntitySlime.AISlimeHop(this));
    this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this));
    this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class));
}
项目:TaleCraft    文件:BarrierEXTBlock.java   
@Deprecated
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean p_185477_7_) {
    int type = state.getValue(TYPE).intValue();
    boolean collide = false;

    switch(type) {
    case 0: // Everything
        collide = true;
        break;

    case 1: // ONLY players
        collide |= collidingEntity instanceof EntityPlayer;
        break;

    case 2: // ALL living
        collide |= collidingEntity instanceof EntityLivingBase;
        break;

    case 3: // ALL living EXCEPT player
        collide |= collidingEntity instanceof EntityLiving;
        break;

    case 4: // ALL monsters
        if(collidingEntity instanceof EntityLiving) {
            EntityLiving living = (EntityLiving) collidingEntity;

            for(Object targetTask : living.targetTasks.taskEntries) {
                if(targetTask instanceof EntityAIFindEntityNearestPlayer) {
                    collide |= true;
                    break;
                }
            }
        }
        break;

    case 5: // ALL villagers
        collide |= collidingEntity instanceof EntityVillager;
        break;

    case 6: // ALL items
        collide |= collidingEntity instanceof EntityItem;
        break;

    default: // Everything.
        collide = true;
        break;
    }

    if(collide) {
        super.addCollisionBoxToList(state, worldIn, pos, mask, list, collidingEntity, p_185477_7_);
    }

}
项目:NeptuneMod    文件:NeptuneAIFactory.java   
@Override
public AIFindEntityNearestPlayer newAIFindEntityNearestPlayer(EntityLiving entityLiving) {
    return (AIFindEntityNearestPlayer) new EntityAIFindEntityNearestPlayer((net.minecraft.entity.EntityLiving) entityLiving);
}