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


Java EntityAIFindEntityNearestPlayer类代码示例

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


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

示例1: removeDummyAIBlockerTask

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:29,代码来源:EntityUtils.java

示例2: initEntityAI

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
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));
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:8,代码来源:EntityDummy.java

示例3: EntityGhast

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
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));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:EntityGhast.java

示例4: EntitySlime

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
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));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:EntitySlime.java

示例5: initEntityAI

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
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));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:EntityGhast.java

示例6: initEntityAI

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
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));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:EntitySlime.java

示例7: initEntityAI

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
@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));
}
 
开发者ID:Modding-Legacy,项目名称:Aether-Legacy,代码行数:11,代码来源:EntitySentry.java

示例8: addCollisionBoxToList

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
@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_);
	}

}
 
开发者ID:tiffit,项目名称:TaleCraft,代码行数:55,代码来源:BarrierEXTBlock.java

示例9: newAIFindEntityNearestPlayer

import net.minecraft.entity.ai.EntityAIFindEntityNearestPlayer; //导入依赖的package包/类
@Override
public AIFindEntityNearestPlayer newAIFindEntityNearestPlayer(EntityLiving entityLiving) {
    return (AIFindEntityNearestPlayer) new EntityAIFindEntityNearestPlayer((net.minecraft.entity.EntityLiving) entityLiving);
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:5,代码来源:NeptuneAIFactory.java


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