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


Java Items.nether_star方法代码示例

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


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

示例1: attackEntityFrom

import net.minecraft.init.Items; //导入方法依赖的package包/类
/**
 * Called when the entity is attacked.
 */
public boolean attackEntityFrom(DamageSource source, float amount)
{
    if (this.isEntityInvulnerable(source))
    {
        return false;
    }
    else if (this.getEntityItem() != null && this.getEntityItem().getItem() == Items.nether_star && source.isExplosion())
    {
        return false;
    }
    else
    {
        this.setBeenAttacked();
        this.health = (int)((float)this.health - amount);

        if (this.health <= 0)
        {
            this.setDead();
        }

        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:EntityItem.java

示例2: getLightLevel

import net.minecraft.init.Items; //导入方法依赖的package包/类
public static int getLightLevel(ItemStack p_getLightLevel_0_)
{
    if (p_getLightLevel_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_getLightLevel_0_.getItem();

        if (item instanceof ItemBlock)
        {
            ItemBlock itemblock = (ItemBlock)item;
            Block block = itemblock.getBlock();

            if (block != null)
            {
                return block.getLightValue();
            }
        }

        return item == Items.lava_bucket ? Blocks.lava.getLightValue() : (item != Items.blaze_rod && item != Items.blaze_powder ? (item == Items.glowstone_dust ? 8 : (item == Items.prismarine_crystals ? 8 : (item == Items.magma_cream ? 8 : (item == Items.nether_star ? Blocks.beacon.getLightValue() / 2 : 0)))) : 10);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:25,代码来源:DynamicLights.java


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