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


Java Items.blaze_rod方法代碼示例

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


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

示例1: 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

示例2: getItemBurnTime

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack p_145952_0_)
{
    if (p_145952_0_ == null)
    {
        return 0;
    }
    else
    {
        Item item = p_145952_0_.getItem();

        if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
        {
            Block block = Block.getBlockFromItem(item);

            if (block == Blocks.wooden_slab)
            {
                return 150;
            }

            if (block.getMaterial() == Material.wood)
            {
                return 300;
            }

            if (block == Blocks.coal_block)
            {
                return 16000;
            }
        }

        return item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD") ? 200 : (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD") ? 200 : (item == Items.stick ? 100 : (item == Items.coal ? 1600 : (item == Items.lava_bucket ? 20000 : (item == Item.getItemFromBlock(Blocks.sapling) ? 100 : (item == Items.blaze_rod ? 2400 : 0)))))));
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:38,代碼來源:TileEntityFurnace.java

示例3: onCollideWithPlayer

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Called by a player entity when they collide with an entity
 */
public void onCollideWithPlayer(EntityPlayer entityIn)
{
    if (!this.worldObj.isRemote)
    {
        ItemStack itemstack = this.getEntityItem();
        int i = itemstack.stackSize;

        if (this.delayBeforeCanPickup == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getName())) && entityIn.inventory.addItemStackToInventory(itemstack))
        {
            if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log))
            {
                entityIn.triggerAchievement(AchievementList.mineWood);
            }

            if (itemstack.getItem() == Item.getItemFromBlock(Blocks.log2))
            {
                entityIn.triggerAchievement(AchievementList.mineWood);
            }

            if (itemstack.getItem() == Items.leather)
            {
                entityIn.triggerAchievement(AchievementList.killCow);
            }

            if (itemstack.getItem() == Items.diamond)
            {
                entityIn.triggerAchievement(AchievementList.diamonds);
            }

            if (itemstack.getItem() == Items.blaze_rod)
            {
                entityIn.triggerAchievement(AchievementList.blazeRod);
            }

            if (itemstack.getItem() == Items.diamond && this.getThrower() != null)
            {
                EntityPlayer entityplayer = this.worldObj.getPlayerEntityByName(this.getThrower());

                if (entityplayer != null && entityplayer != entityIn)
                {
                    entityplayer.triggerAchievement(AchievementList.diamondsToYou);
                }
            }

            if (!this.isSilent())
            {
                this.worldObj.playSoundAtEntity(entityIn, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
            }

            entityIn.onItemPickup(this, i);

            if (itemstack.stackSize <= 0)
            {
                this.setDead();
            }
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:62,代碼來源:EntityItem.java

示例4: getDropItem

import net.minecraft.init.Items; //導入方法依賴的package包/類
protected Item getDropItem()
{
    return Items.blaze_rod;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:5,代碼來源:EntityBlaze.java


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