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


Java EntityLivingBase.isEntityAlive方法代码示例

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


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

示例1: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.field_179442_b.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else
    {
        double d0 = this.func_179438_f();
        return this.field_179442_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:EntityAIFindEntityNearest.java

示例2: onUpdate

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    EntityLivingBase entitylivingbase = this.getThrower();

    if (entitylivingbase != null && entitylivingbase instanceof EntityPlayer && !entitylivingbase.isEntityAlive())
    {
        this.setDead();
    }
    else
    {
        super.onUpdate();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:EntityEnderPearl.java

示例3: cast

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@SuppressWarnings("ConstantConditions")
@Override
public void cast(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
	final EntityLivingBase entity = (EntityLivingBase) sender.getCommandSenderEntity();
	if (entity.isEntityAlive() && entity.getHealth() < entity.getMaxHealth()) {
		entity.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 80, 0));
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:9,代码来源:IncantationHeal.java

示例4: shouldContinueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * A method used to see if an entity is a suitable target through a number
 * of checks. Args : entity, canTargetInvinciblePlayer
 */
@Override
public boolean shouldContinueExecuting() {
	EntityLivingBase entitylivingbase = this.taskOwner.getAttackTarget();

	if (entitylivingbase == null)
		return false;
	else if (!entitylivingbase.isEntityAlive())
		return false;
	else if(!this.targetLock && this.taskOwner.ticksExisted % 13 == 0)
		return this.shouldExecute();
	else {
		Team team = this.taskOwner.getTeam();
		Team team1 = entitylivingbase.getTeam();

		if ((team != null && team1 == team) && !(this.taskOwner instanceof EntityMedic))
			return false;
		else {
			double d0 = this.getTargetDistance();

			if (this.taskOwner.getDistanceSqToEntity(entitylivingbase) > d0 * d0)
				return false;
			else {
				if (this.shouldCheckSight)
					if (this.taskOwner.getEntitySenses().canSee(entitylivingbase))
						this.targetUnseenTicks = 0;
					else if (++this.targetUnseenTicks > 60)
						return false;

				return !(entitylivingbase instanceof EntityPlayer)
						|| !((EntityPlayer) entitylivingbase).capabilities.disableDamage;
			}
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:39,代码来源:EntityAINearestChecked.java

示例5: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) {
	if (target == null)
		return false;
	else if (target == this.taskOwner)
		return false;
	else if (!target.isEntityAlive())
		return false;
	else if (!this.taskOwner.canAttackClass(target.getClass()))
		return false;
	else{
		Team team = this.taskOwner.getTeam();
		Team team1 = target.getTeam();
		boolean medic = (this.taskOwner instanceof EntityMedic);
		if ((team != null && team1 == team) && !medic)
			return false;
		else {
			if (!medic && this.taskOwner instanceof IEntityOwnable
					&& ((IEntityOwnable) this.taskOwner).getOwnerId() != null) {
				if (target instanceof IEntityOwnable && ((IEntityOwnable) this.taskOwner).getOwnerId()
						.equals(((IEntityOwnable) target).getOwnerId()))
					return false;

				if (target == ((IEntityOwnable) this.taskOwner).getOwner())
					return false;
			} else if (target instanceof EntityPlayer && !includeInvincibles
					&& ((EntityPlayer) target).capabilities.disableDamage)
				return false;

			return !this.shouldCheckSight || this.taskOwner.getEntitySenses().canSee(target);
		}
	}
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:34,代码来源:EntityAINearestChecked.java

示例6: drawEsp

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public static void drawEsp(EntityLivingBase ent, float pTicks, int hexColor, int hexColorIn) {
    if (!ent.isEntityAlive()) {
        return;
    }
    double x = RenderUtils.getDiff(ent.lastTickPosX, ent.posX, pTicks, RenderManager.renderPosX);
    double y = RenderUtils.getDiff(ent.lastTickPosY, ent.posY, pTicks, RenderManager.renderPosY);
    double z = RenderUtils.getDiff(ent.lastTickPosZ, ent.posZ, pTicks, RenderManager.renderPosZ);
    RenderUtils.boundingBox((Entity)ent, x, y, z, hexColor, hexColorIn);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:10,代码来源:RenderUtils.java

示例7: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.field_179434_b.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
    {
        return false;
    }
    else
    {
        Team team = this.field_179434_b.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.func_179431_f();
            return this.field_179434_b.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).theItemInWorldManager.isCreative();
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:EntityAIFindEntityNearestPlayer.java

示例8: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.entityLiving.getAttackTarget();

    if (entitylivingbase == null)
    {
        return false;
    }
    else if (!entitylivingbase.isEntityAlive())
    {
        return false;
    }
    else if (entitylivingbase instanceof EntityPlayer && ((EntityPlayer)entitylivingbase).capabilities.disableDamage)
    {
        return false;
    }
    else
    {
        Team team = this.entityLiving.getTeam();
        Team team1 = entitylivingbase.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            double d0 = this.maxTargetRange();
            return this.entityLiving.getDistanceSqToEntity(entitylivingbase) > d0 * d0 ? false : !(entitylivingbase instanceof EntityPlayerMP) || !((EntityPlayerMP)entitylivingbase).interactionManager.isCreative();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:36,代码来源:EntityAIFindEntityNearestPlayer.java

示例9: shouldExecute

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:EntityBlaze.java

示例10: shouldExecute

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = this.theEntity.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:EntityGuardian.java

示例11: shouldExecute

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = this.blaze.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:EntityBlaze.java

示例12: isSuitableTarget

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * A static method used to see if an entity is a suitable target through a number of checks.
 */
public static boolean isSuitableTarget(EntityLiving attacker, EntityLivingBase target, boolean includeInvincibles, boolean checkSight)
{
    if (target == null)
    {
        return false;
    }
    else if (target == attacker)
    {
        return false;
    }
    else if (!target.isEntityAlive())
    {
        return false;
    }
    else if (!attacker.canAttackClass(target.getClass()))
    {
        return false;
    }
    else
    {
        Team team = attacker.getTeam();
        Team team1 = target.getTeam();

        if (team != null && team1 == team)
        {
            return false;
        }
        else
        {
            if (attacker instanceof IEntityOwnable && StringUtils.isNotEmpty(((IEntityOwnable)attacker).getOwnerId()))
            {
                if (target instanceof IEntityOwnable && ((IEntityOwnable)attacker).getOwnerId().equals(((IEntityOwnable)target).getOwnerId()))
                {
                    return false;
                }

                if (target == ((IEntityOwnable)attacker).getOwner())
                {
                    return false;
                }
            }
            else if (target instanceof EntityPlayer && !includeInvincibles && ((EntityPlayer)target).capabilities.disableDamage)
            {
                return false;
            }

            return !checkSight || attacker.getEntitySenses().canSee(target);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:EntityAITarget.java

示例13: continueExecuting

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether an in-progress EntityAIBase should continue executing
 */
public boolean continueExecuting()
{
    EntityLivingBase entitylivingbase = this.attacker.getAttackTarget();
    return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistanceFromPosition(new BlockPos(entitylivingbase))));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:9,代码来源:EntityAIAttackOnCollide.java

示例14: shouldExecute

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = EntityShulker.this.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive() ? EntityShulker.this.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL : false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:EntityShulker.java

示例15: shouldExecute

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public boolean shouldExecute()
{
    EntityLivingBase entitylivingbase = EntityShulker.this.getAttackTarget();
    return entitylivingbase != null && entitylivingbase.isEntityAlive() ? EntityShulker.this.world.getDifficulty() != EnumDifficulty.PEACEFUL : false;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:EntityShulker.java


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