當前位置: 首頁>>代碼示例>>Java>>正文


Java Entity.isEntityAlive方法代碼示例

本文整理匯總了Java中net.minecraft.entity.Entity.isEntityAlive方法的典型用法代碼示例。如果您正苦於以下問題:Java Entity.isEntityAlive方法的具體用法?Java Entity.isEntityAlive怎麽用?Java Entity.isEntityAlive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.Entity的用法示例。


在下文中一共展示了Entity.isEntityAlive方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: apply

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public boolean apply(Entity p_apply_1_)
{
    if (!p_apply_1_.isEntityAlive())
    {
        return false;
    }
    else if (!(p_apply_1_ instanceof EntityLivingBase))
    {
        return false;
    }
    else
    {
        EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_;
        return entitylivingbase.getEquipmentInSlot(EntityLiving.getArmorPosition(this.armor)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer));
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:EntitySelectors.java

示例2: onEntityRemoved

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
protected void onEntityRemoved(Entity entityIn)
{
    super.onEntityRemoved(entityIn);

    if (this.entityList.contains(entityIn))
    {
        if (entityIn.isEntityAlive())
        {
            this.entitySpawnQueue.add(entityIn);
        }
        else
        {
            this.entityList.remove(entityIn);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:17,代碼來源:WorldClient.java

示例3: onEntityRemoved

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void onEntityRemoved(Entity entityIn)
{
    super.onEntityRemoved(entityIn);

    if (this.entityList.contains(entityIn))
    {
        if (entityIn.isEntityAlive())
        {
            this.entitySpawnQueue.add(entityIn);
        }
        else
        {
            this.entityList.remove(entityIn);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:17,代碼來源:WorldClient.java

示例4: onHitMob

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public void onHitMob(Entity entityHit, RayTraceResult mop) {
	super.onHitMob(entityHit, mop);
	if(!this.world.isRemote && this.isDead) {
		if(entityHit.isEntityAlive()) {
			NBTTagList list=entityHit.getEntityData().getTagList("Cleavers", 10);
			list.appendTag(this.usedWeapon.serializeNBT());
			if(!entityHit.getEntityData().hasKey("Cleavers"))
				entityHit.getEntityData().setTag("Cleavers", list);
		}
		else
			this.entityDropItem(this.usedWeapon, 0f);
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:15,代碼來源:EntityCleaver.java

示例5: onDealDamage

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void onDealDamage(ItemStack stack, EntityLivingBase attacker, Entity target, DamageSource source, float amount) {
	super.onDealDamage(stack, attacker, target, source, amount);
	if(attacker instanceof EntityPlayer && !target.isEntityAlive() && target instanceof EntityLivingBase && TF2Util.isEnemy(attacker, (EntityLivingBase) target)){
		attacker.getCapability(TF2weapons.WEAPONS_CAP, null).killsSpinning++;
		/*if(attacker.getCapability(TF2weapons.WEAPONS_CAP, null).killsSpinning>=8)
			((EntityPlayer)attacker).addStat(TF2Achievements.REVOLUTION);*/
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:9,代碼來源:ItemMinigun.java

示例6: removeEntity

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void removeEntity(Entity entityIn)
{
    if (entityIn != null && !(entityIn instanceof EntityPlayer) && !entityIn.isEntityAlive())
    {
        String s = entityIn.getCachedUniqueIdString();
        this.removeObjectiveFromEntity(s, (ScoreObjective)null);
        this.removePlayerFromTeams(s);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:10,代碼來源:Scoreboard.java

示例7: func_181140_a

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void func_181140_a(Entity p_181140_1_)
{
    if (p_181140_1_ != null && !(p_181140_1_ instanceof EntityPlayer) && !p_181140_1_.isEntityAlive())
    {
        String s = p_181140_1_.getUniqueID().toString();
        this.removeObjectiveFromEntity(s, (ScoreObjective)null);
        this.removePlayerFromTeams(s);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:Scoreboard.java

示例8: onDealDamage

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public void onDealDamage(ItemStack stack, EntityLivingBase attacker, Entity target, DamageSource source, float amount) {
	super.onDealDamage(stack, attacker, target, source, amount);
	TF2PlayerCapability cap=attacker.getCapability(TF2weapons.PLAYER_CAP, null);
	if(attacker instanceof EntityPlayer && !target.isEntityAlive()){
		if(target instanceof EntityLivingBase && !(target instanceof EntityBuilding))
			cap.stickybombKilled++;
		if(target instanceof EntityEngineer)
			cap.engineerKilled=true;
		else if(target instanceof EntitySentry)
			cap.sentryKilled=true;
		else if(target instanceof EntityDispenser)
			cap.dispenserKilled=true;
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:15,代碼來源:ItemStickyLauncher.java

示例9: apply

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public boolean apply(@Nullable Entity p_apply_1_)
{
    return p_apply_1_.isEntityAlive();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:5,代碼來源:EntitySelectors.java

示例10: onUpdate

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    this.interactionManager.updateBlockRemoving();
    --this.respawnInvulnerabilityTicks;

    if (this.hurtResistantTime > 0)
    {
        --this.hurtResistantTime;
    }

    this.openContainer.detectAndSendChanges();

    if (!this.world.isRemote && !this.openContainer.canInteractWith(this))
    {
        this.closeScreen();
        this.openContainer = this.inventoryContainer;
    }

    while (!this.entityRemoveQueue.isEmpty())
    {
        int i = Math.min(this.entityRemoveQueue.size(), Integer.MAX_VALUE);
        int[] aint = new int[i];
        Iterator<Integer> iterator = this.entityRemoveQueue.iterator();
        int j = 0;

        while (iterator.hasNext() && j < i)
        {
            aint[j++] = ((Integer)iterator.next()).intValue();
            iterator.remove();
        }

        this.connection.sendPacket(new SPacketDestroyEntities(aint));
    }

    Entity entity = this.getSpectatingEntity();

    if (entity != this)
    {
        if (entity.isEntityAlive())
        {
            this.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
            this.mcServer.getPlayerList().serverUpdateMovingPlayer(this);

            if (this.isSneaking())
            {
                this.setSpectatingEntity(this);
            }
        }
        else
        {
            this.setSpectatingEntity(this);
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:58,代碼來源:EntityPlayerMP.java

示例11: transferEntityToWorld

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Transfers an entity from a world to another world.
 */
public void transferEntityToWorld(Entity entityIn, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_)
{
    double d0 = entityIn.posX;
    double d1 = entityIn.posZ;
    double d2 = 8.0D;
    float f = entityIn.rotationYaw;
    p_82448_3_.theProfiler.startSection("moving");

    if (entityIn.dimension == -1)
    {
        d0 = MathHelper.clamp_double(d0 / d2, p_82448_4_.getWorldBorder().minX() + 16.0D, p_82448_4_.getWorldBorder().maxX() - 16.0D);
        d1 = MathHelper.clamp_double(d1 / d2, p_82448_4_.getWorldBorder().minZ() + 16.0D, p_82448_4_.getWorldBorder().maxZ() - 16.0D);
        entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);

        if (entityIn.isEntityAlive())
        {
            p_82448_3_.updateEntityWithOptionalForce(entityIn, false);
        }
    }
    else if (entityIn.dimension == 0)
    {
        d0 = MathHelper.clamp_double(d0 * d2, p_82448_4_.getWorldBorder().minX() + 16.0D, p_82448_4_.getWorldBorder().maxX() - 16.0D);
        d1 = MathHelper.clamp_double(d1 * d2, p_82448_4_.getWorldBorder().minZ() + 16.0D, p_82448_4_.getWorldBorder().maxZ() - 16.0D);
        entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);

        if (entityIn.isEntityAlive())
        {
            p_82448_3_.updateEntityWithOptionalForce(entityIn, false);
        }
    }
    else
    {
        BlockPos blockpos;

        if (p_82448_2_ == 1)
        {
            blockpos = p_82448_4_.getSpawnPoint();
        }
        else
        {
            blockpos = p_82448_4_.getSpawnCoordinate();
        }

        d0 = (double)blockpos.getX();
        entityIn.posY = (double)blockpos.getY();
        d1 = (double)blockpos.getZ();
        entityIn.setLocationAndAngles(d0, entityIn.posY, d1, 90.0F, 0.0F);

        if (entityIn.isEntityAlive())
        {
            p_82448_3_.updateEntityWithOptionalForce(entityIn, false);
        }
    }

    p_82448_3_.theProfiler.endSection();

    if (p_82448_2_ != 1)
    {
        p_82448_3_.theProfiler.startSection("placing");
        d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872);
        d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872);

        if (entityIn.isEntityAlive())
        {
            entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);
            p_82448_4_.getDefaultTeleporter().placeInPortal(entityIn, f);
            p_82448_4_.spawnEntityInWorld(entityIn);
            p_82448_4_.updateEntityWithOptionalForce(entityIn, false);
        }

        p_82448_3_.theProfiler.endSection();
    }

    entityIn.setWorld(p_82448_4_);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:79,代碼來源:ServerConfigurationManager.java

示例12: apply

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public boolean apply(Entity p_apply_1_)
{
    return p_apply_1_.isEntityAlive();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:EntitySelectors.java

示例13: transferEntityToWorld

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@SuppressWarnings("unused")
public void transferEntityToWorld(Entity entityIn, int lastDimension, WorldServer oldWorldIn, WorldServer toWorldIn, net.minecraft.world.Teleporter teleporter)
{
    net.minecraft.world.WorldProvider pOld = oldWorldIn.provider;
    net.minecraft.world.WorldProvider pNew = toWorldIn.provider;
    double moveFactor = pOld.getMovementFactor() / pNew.getMovementFactor();
    double d0 = entityIn.posX * moveFactor;
    double d1 = entityIn.posZ * moveFactor;
    double d2 = 8.0D;
    float f = entityIn.rotationYaw;
    oldWorldIn.theProfiler.startSection("moving");

    if (false && entityIn.dimension == -1)
    {
        d0 = MathHelper.clamp_double(d0 / 8.0D, toWorldIn.getWorldBorder().minX() + 16.0D, toWorldIn.getWorldBorder().maxX() - 16.0D);
        d1 = MathHelper.clamp_double(d1 / 8.0D, toWorldIn.getWorldBorder().minZ() + 16.0D, toWorldIn.getWorldBorder().maxZ() - 16.0D);
        entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);

        if (entityIn.isEntityAlive())
        {
            oldWorldIn.updateEntityWithOptionalForce(entityIn, false);
        }
    }
    else if (false && entityIn.dimension == 0)
    {
        d0 = MathHelper.clamp_double(d0 * 8.0D, toWorldIn.getWorldBorder().minX() + 16.0D, toWorldIn.getWorldBorder().maxX() - 16.0D);
        d1 = MathHelper.clamp_double(d1 * 8.0D, toWorldIn.getWorldBorder().minZ() + 16.0D, toWorldIn.getWorldBorder().maxZ() - 16.0D);
        entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);

        if (entityIn.isEntityAlive())
        {
            oldWorldIn.updateEntityWithOptionalForce(entityIn, false);
        }
    }

    if (entityIn.dimension == 1)
    {
        BlockPos blockpos;

        if (lastDimension == 1)
        {
            blockpos = toWorldIn.getSpawnPoint();
        }
        else
        {
            blockpos = toWorldIn.getSpawnCoordinate();
        }

        d0 = (double)blockpos.getX();
        entityIn.posY = (double)blockpos.getY();
        d1 = (double)blockpos.getZ();
        entityIn.setLocationAndAngles(d0, entityIn.posY, d1, 90.0F, 0.0F);

        if (entityIn.isEntityAlive())
        {
            oldWorldIn.updateEntityWithOptionalForce(entityIn, false);
        }
    }

    oldWorldIn.theProfiler.endSection();

    if (lastDimension != 1)
    {
        oldWorldIn.theProfiler.startSection("placing");
        d0 = (double)MathHelper.clamp_int((int)d0, -29999872, 29999872);
        d1 = (double)MathHelper.clamp_int((int)d1, -29999872, 29999872);

        if (entityIn.isEntityAlive())
        {
            entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);
            teleporter.placeInPortal(entityIn, f);
            toWorldIn.spawnEntityInWorld(entityIn);
            toWorldIn.updateEntityWithOptionalForce(entityIn, false);
        }

        oldWorldIn.theProfiler.endSection();
    }

    entityIn.setWorld(toWorldIn);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:81,代碼來源:PlayerList.java


注:本文中的net.minecraft.entity.Entity.isEntityAlive方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。