本文整理汇总了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));
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);*/
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例9: apply
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public boolean apply(@Nullable Entity p_apply_1_)
{
return p_apply_1_.isEntityAlive();
}
示例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);
}
}
}
示例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_);
}
示例12: apply
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public boolean apply(Entity p_apply_1_)
{
return p_apply_1_.isEntityAlive();
}
示例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);
}