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


Java EntityMoveHelper类代码示例

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


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

示例1: shouldExecute

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper();

    if (!entitymovehelper.isUpdating())
    {
        return true;
    }
    else
    {
        double d0 = entitymovehelper.getX() - this.parentEntity.posX;
        double d1 = entitymovehelper.getY() - this.parentEntity.posY;
        double d2 = entitymovehelper.getZ() - this.parentEntity.posZ;
        double d3 = d0 * d0 + d1 * d1 + d2 * d2;
        return d3 < 1.0D || d3 > 3600.0D;
    }
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:21,代码来源:AIRandomFly.java

示例2: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World worldIn)
{
    super(worldIn);
    this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.targetTasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = new EntityBodyHelper(this);
    this.navigator = this.getNewNavigator(worldIn);
    this.senses = new EntitySenses(this);

    for (int i = 0; i < this.equipmentDropChances.length; ++i)
    {
        this.equipmentDropChances[i] = 0.085F;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntityLiving.java

示例3: shouldExecute

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public boolean shouldExecute()
{
    EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper();

    if (!entitymovehelper.isUpdating())
    {
        return true;
    }
    else
    {
        double d0 = entitymovehelper.getX() - this.parentEntity.posX;
        double d1 = entitymovehelper.getY() - this.parentEntity.posY;
        double d2 = entitymovehelper.getZ() - this.parentEntity.posZ;
        double d3 = d0 * d0 + d1 * d1 + d2 * d2;
        return d3 < 1.0D || d3 > 3600.0D;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:18,代码来源:EntityGhast.java

示例4: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World worldIn)
{
    super(worldIn);
    this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.targetTasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = new EntityBodyHelper(this);
    this.navigator = this.getNewNavigator(worldIn);
    this.senses = new EntitySenses(this);

    for (int i = 0; i < this.equipmentDropChances.length; ++i)
    {
        this.equipmentDropChances[i] = 0.085F;
    }

    UUID uuid = this.getUniqueID();
    long j = uuid.getLeastSignificantBits();
    this.randomMobsId = (int)(j & 2147483647L);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:EntityLiving.java

示例5: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World worldIn)
{
    super(worldIn);
    this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.targetTasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = this.createBodyHelper();
    this.navigator = this.getNewNavigator(worldIn);
    this.senses = new EntitySenses(this);
    Arrays.fill(this.inventoryArmorDropChances, 0.085F);
    Arrays.fill(this.inventoryHandsDropChances, 0.085F);

    if (worldIn != null && !worldIn.isRemote)
    {
        this.initEntityAI();
    }

    UUID uuid = this.getUniqueID();
    long i = uuid.getLeastSignificantBits();
    this.randomMobsId = (int)(i & 2147483647L);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:EntityLiving.java

示例6: setBombSpell

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public void setBombSpell(boolean bomb) {
	this.getDataManager().set(SPELL_BOMB, bomb);
	this.getNavigator().clearPathEntity();
	if(bomb){
		this.moveHelper=new FloatingMoveHelper(this);
		this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, ItemFromData.getNewStack("bombinomicon"));
		this.playSound(TF2Sounds.MOB_MERASMUS_BOMBINOMICON, 3.3F, 1F);
	}
	else{
		this.moveHelper=new EntityMoveHelper(this);
		this.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, ItemStack.EMPTY);
	}
	TF2Attribute.setAttribute(this.getHeldItemMainhand(), TF2Attribute.attributes[19],
			bomb?0.65f:1);
	TF2Attribute.setAttribute(this.getHeldItemMainhand(), TF2Attribute.attributes[39],
			bomb?0f:0.3f);
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:18,代码来源:EntityMerasmus.java

示例7: onUpdateMoveHelper

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
@Override
public void onUpdateMoveHelper() {
	if (this.action == EntityMoveHelper.Action.MOVE_TO) {
		double d0 = this.posX - this.parentEntity.posX;
		double d1 = this.posY - this.parentEntity.posY;
		double d2 = this.posZ - this.parentEntity.posZ;
		double d3 = d0 * d0 + d1 * d1 + d2 * d2;

		if (this.courseChangeCooldown-- <= 0) {
			this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2;
			d3 = MathHelper.sqrt(d3);

			if (this.isNotColliding(this.posX, this.posY, this.posZ, d3)) {
				this.parentEntity.motionX += d0 / d3 * 0.05D;
				this.parentEntity.motionZ += d2 / d3 * 0.05D;
			} else
				this.action = EntityMoveHelper.Action.WAIT;
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:21,代码来源:EntityMerasmus.java

示例8: shouldExecute

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
@Override
public boolean shouldExecute() {
	if (this.parentEntity.begin > 0)
		return false;
	EntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper();

	if (!entitymovehelper.isUpdating())
		return true;
	else {
		double d0 = entitymovehelper.getX() - this.parentEntity.posX;
		double d1 = entitymovehelper.getY() - this.parentEntity.posY;
		double d2 = entitymovehelper.getZ() - this.parentEntity.posZ;
		double d3 = d0 * d0 + d1 * d1 + d2 * d2;
		return d3 < 1.0D || d3 > 3600.0D;
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:20,代码来源:EntityMonoculus.java

示例9: onUpdateMoveHelper

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
@Override
public void onUpdateMoveHelper() {
	if (this.action == EntityMoveHelper.Action.MOVE_TO) {
		double d0 = this.posX - this.parentEntity.posX;
		double d1 = this.posY - this.parentEntity.posY;
		double d2 = this.posZ - this.parentEntity.posZ;
		double d3 = d0 * d0 + d1 * d1 + d2 * d2;

		if (this.courseChangeCooldown-- <= 0) {
			this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2;
			d3 = MathHelper.sqrt(d3);

			if (this.isNotColliding(this.posX, this.posY, this.posZ, d3)) {
				this.parentEntity.motionX += d0 / d3 * 0.1D;
				this.parentEntity.motionY += d1 / d3 * 0.1D;
				this.parentEntity.motionZ += d2 / d3 * 0.1D;
			} else
				this.action = EntityMoveHelper.Action.WAIT;
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:22,代码来源:EntityMonoculus.java

示例10: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World worldIn)
{
    super(worldIn);
    this.tasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.targetTasks = new EntityAITasks(worldIn != null && worldIn.theProfiler != null ? worldIn.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = this.createBodyHelper();
    this.navigator = this.getNewNavigator(worldIn);
    this.senses = new EntitySenses(this);
    Arrays.fill(this.inventoryArmorDropChances, 0.085F);
    Arrays.fill(this.inventoryHandsDropChances, 0.085F);

    if (worldIn != null && !worldIn.isRemote)
    {
        this.initEntityAI();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:EntityLiving.java

示例11: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World par1World)
{
    super(par1World);
    this.tasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null);
    this.targetTasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = new EntityBodyHelper(this);
    this.navigator = new PathNavigate(this, par1World);
    this.senses = new EntitySenses(this);

    for (int var2 = 0; var2 < this.equipmentDropChances.length; ++var2)
    {
        this.equipmentDropChances[var2] = 0.085F;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:18,代码来源:EntityLiving.java

示例12: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World p_i1595_1_)
{
    super(p_i1595_1_);
    this.tasks = new EntityAITasks(p_i1595_1_ != null && p_i1595_1_.theProfiler != null ? p_i1595_1_.theProfiler : null);
    this.targetTasks = new EntityAITasks(p_i1595_1_ != null && p_i1595_1_.theProfiler != null ? p_i1595_1_.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = new EntityBodyHelper(this);
    this.navigator = new PathNavigate(this, p_i1595_1_);
    this.senses = new EntitySenses(this);

    for (int i = 0; i < this.equipmentDropChances.length; ++i)
    {
        this.equipmentDropChances[i] = 0.085F;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:18,代码来源:EntityLiving.java

示例13: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World p_i1595_1_) {
   super(p_i1595_1_);
   this.field_70714_bg = new EntityAITasks(p_i1595_1_ != null && p_i1595_1_.field_72984_F != null?p_i1595_1_.field_72984_F:null);
   this.field_70715_bh = new EntityAITasks(p_i1595_1_ != null && p_i1595_1_.field_72984_F != null?p_i1595_1_.field_72984_F:null);
   this.field_70749_g = new EntityLookHelper(this);
   this.field_70765_h = new EntityMoveHelper(this);
   this.field_70767_i = new EntityJumpHelper(this);
   this.field_70762_j = new EntityBodyHelper(this);
   this.field_70699_by = new PathNavigate(this, p_i1595_1_);
   this.field_70723_bA = new EntitySenses(this);

   for(int var2 = 0; var2 < this.field_82174_bp.length; ++var2) {
      this.field_82174_bp[var2] = 0.085F;
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:17,代码来源:EntityLiving.java

示例14: EntityLiving

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public EntityLiving(World par1World)
{
    super(par1World);
    this.tasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null);
    this.targetTasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null);
    this.lookHelper = new EntityLookHelper(this);
    this.moveHelper = new EntityMoveHelper(this);
    this.jumpHelper = new EntityJumpHelper(this);
    this.bodyHelper = new EntityBodyHelper(this);
    this.navigator = new PathNavigate(this, par1World);
    this.senses = new EntitySenses(this);

    for (int i = 0; i < this.equipmentDropChances.length; ++i)
    {
        this.equipmentDropChances[i] = 0.085F;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:18,代码来源:EntityLiving.java

示例15: onUpdateMoveHelper

import net.minecraft.entity.ai.EntityMoveHelper; //导入依赖的package包/类
public void onUpdateMoveHelper()
{
    if (this.action == EntityMoveHelper.Action.MOVE_TO)
    {
        double d0 = this.posX - this.parentEntity.posX;
        double d1 = this.posY - this.parentEntity.posY;
        double d2 = this.posZ - this.parentEntity.posZ;
        double d3 = d0 * d0 + d1 * d1 + d2 * d2;

        if (this.courseChangeCooldown-- <= 0)
        {
            this.courseChangeCooldown += this.parentEntity.getRNG().nextInt(5) + 2;
            d3 = (double)MathHelper.sqrt_double(d3);

            if (this.isNotColliding(this.posX, this.posY, this.posZ, d3))
            {
                this.parentEntity.motionX += d0 / d3 * 0.1D;
                this.parentEntity.motionY += d1 / d3 * 0.1D;
                this.parentEntity.motionZ += d2 / d3 * 0.1D;
            }
            else
            {
                this.action = EntityMoveHelper.Action.WAIT;
            }
        }
    }
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:28,代码来源:FlyMoveHelper.java


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