本文整理匯總了Java中net.minecraft.entity.EntityLivingBase.getEquipmentInSlot方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityLivingBase.getEquipmentInSlot方法的具體用法?Java EntityLivingBase.getEquipmentInSlot怎麽用?Java EntityLivingBase.getEquipmentInSlot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.entity.EntityLivingBase
的用法示例。
在下文中一共展示了EntityLivingBase.getEquipmentInSlot方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import net.minecraft.entity.EntityLivingBase; //導入方法依賴的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: onLivingUpdate
import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public static void onLivingUpdate(EntityLivingBase entity) {
if (entity.worldObj.isRemote)
return;
if (!EtFuturum.enableFrostWalker)
return;
ItemStack boots = entity.getEquipmentInSlot(1);
int level = 0;
if ((level = EnchantmentHelper.getEnchantmentLevel(frostWalker.effectId, boots)) > 0)
if (entity.onGround) {
int x = (int) entity.posX;
int y = (int) entity.posY;
int z = (int) entity.posZ;
int radius = 1 + level;
for (int i = -radius; i <= radius; i++)
for (int j = -radius; j <= radius; j++) {
Block block = entity.worldObj.getBlock(x + i, y - 1, z + j);
if (block == Blocks.water || block == Blocks.flowing_water)
entity.worldObj.setBlock(x + i, y - 1, z + j, ModBlocks.frosted_ice);
}
}
}
示例3: getLightLevel
import net.minecraft.entity.EntityLivingBase; //導入方法依賴的package包/類
public static int getLightLevel(Entity p_getLightLevel_0_)
{
if (p_getLightLevel_0_ == Config.getMinecraft().getRenderViewEntity() && !Config.isDynamicHandLight())
{
return 0;
}
else
{
if (p_getLightLevel_0_ instanceof EntityPlayer)
{
EntityPlayer entityplayer = (EntityPlayer)p_getLightLevel_0_;
if (entityplayer.isSpectator())
{
return 0;
}
}
if (p_getLightLevel_0_.isBurning())
{
return 15;
}
else if (p_getLightLevel_0_ instanceof EntityFireball)
{
return 15;
}
else if (p_getLightLevel_0_ instanceof EntityTNTPrimed)
{
return 15;
}
else if (p_getLightLevel_0_ instanceof EntityBlaze)
{
EntityBlaze entityblaze = (EntityBlaze)p_getLightLevel_0_;
return entityblaze.func_70845_n() ? 15 : 10;
}
else if (p_getLightLevel_0_ instanceof EntityMagmaCube)
{
EntityMagmaCube entitymagmacube = (EntityMagmaCube)p_getLightLevel_0_;
return (double)entitymagmacube.squishFactor > 0.6D ? 13 : 8;
}
else
{
if (p_getLightLevel_0_ instanceof EntityCreeper)
{
EntityCreeper entitycreeper = (EntityCreeper)p_getLightLevel_0_;
if ((double)entitycreeper.getCreeperFlashIntensity(0.0F) > 0.001D)
{
return 15;
}
}
if (p_getLightLevel_0_ instanceof EntityLivingBase)
{
EntityLivingBase entitylivingbase = (EntityLivingBase)p_getLightLevel_0_;
ItemStack itemstack2 = entitylivingbase.getHeldItem();
int i = getLightLevel(itemstack2);
ItemStack itemstack1 = entitylivingbase.getEquipmentInSlot(4);
int j = getLightLevel(itemstack1);
return Math.max(i, j);
}
else if (p_getLightLevel_0_ instanceof EntityItem)
{
EntityItem entityitem = (EntityItem)p_getLightLevel_0_;
ItemStack itemstack = getItemStack(entityitem);
return getLightLevel(itemstack);
}
else
{
return 0;
}
}
}
}