本文整理汇总了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;
}
}
}
}