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


Java Items.field_190931_a方法代碼示例

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


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

示例1: dropBlockAsItemWithChance

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Spawns this Block's drops into the World as EntityItems.
 */
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
{
    if (!worldIn.isRemote)
    {
        int i = this.quantityDroppedWithBonus(fortune, worldIn.rand);

        for (int j = 0; j < i; ++j)
        {
            if (worldIn.rand.nextFloat() <= chance)
            {
                Item item = this.getItemDropped(state, worldIn.rand, fortune);

                if (item != Items.field_190931_a)
                {
                    spawnAsEntity(worldIn, pos, new ItemStack(item, 1, this.damageDropped(state)));
                }
            }
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:Block.java

示例2: initMiningStats

import net.minecraft.init.Items; //導入方法依賴的package包/類
private static void initMiningStats()
{
    for (Block block : Block.REGISTRY)
    {
        Item item = Item.getItemFromBlock(block);

        if (item != Items.field_190931_a)
        {
            int i = Block.getIdFromBlock(block);
            String s = getItemName(item);

            if (s != null && block.getEnableStats())
            {
                BLOCKS_STATS[i] = (new StatCrafting("stat.mineBlock.", s, new TextComponentTranslation("stat.mineBlock", new Object[] {(new ItemStack(block)).getTextComponent()}), item)).registerStat();
                MINE_BLOCK_STATS.add((StatCrafting)BLOCKS_STATS[i]);
            }
        }
    }

    replaceAllSimilarBlocks(BLOCKS_STATS);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:22,代碼來源:StatList.java

示例3: getItemDropped

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    if (state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER)
    {
        return Items.field_190931_a;
    }
    else
    {
        BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype = (BlockDoublePlant.EnumPlantType)state.getValue(VARIANT);
        return blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.FERN ? Items.field_190931_a : (blockdoubleplant$enumplanttype == BlockDoublePlant.EnumPlantType.GRASS ? (rand.nextInt(8) == 0 ? Items.WHEAT_SEEDS : Items.field_190931_a) : super.getItemDropped(state, rand, fortune));
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:16,代碼來源:BlockDoublePlant.java

示例4: harvestBlock

import net.minecraft.init.Items; //導入方法依賴的package包/類
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, @Nullable TileEntity te, ItemStack stack)
{
    if (te instanceof IWorldNameable && ((IWorldNameable)te).hasCustomName())
    {
        player.addStat(StatList.getBlockStats(this));
        player.addExhaustion(0.005F);

        if (worldIn.isRemote)
        {
            return;
        }

        int i = EnchantmentHelper.getEnchantmentLevel(Enchantments.FORTUNE, stack);
        Item item = this.getItemDropped(state, worldIn.rand, i);

        if (item == Items.field_190931_a)
        {
            return;
        }

        ItemStack itemstack = new ItemStack(item, this.quantityDropped(worldIn.rand));
        itemstack.setStackDisplayName(((IWorldNameable)te).getName());
        spawnAsEntity(worldIn, pos, itemstack);
    }
    else
    {
        super.harvestBlock(worldIn, player, pos, state, (TileEntity)null, stack);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:30,代碼來源:BlockContainer.java

示例5: getItemFromBlock

import net.minecraft.init.Items; //導入方法依賴的package包/類
public static Item getItemFromBlock(Block blockIn)
{
    Item item = (Item)BLOCK_TO_ITEM.get(blockIn);
    return item == null ? Items.field_190931_a : item;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:6,代碼來源:Item.java

示例6: getItemDropped

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return Items.field_190931_a;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockPistonMoving.java

示例7: getItemDropped

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? Items.field_190931_a : this.getItem();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockDoor.java

示例8: getItemDropped

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return state.getValue(PART) == BlockBed.EnumPartType.HEAD ? Items.field_190931_a : Items.BED;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockBed.java

示例9: getItemDropped

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return !this.canDrop ? Items.field_190931_a : super.getItemDropped(state, rand, fortune);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockPane.java

示例10: getItemDropped

import net.minecraft.init.Items; //導入方法依賴的package包/類
/**
 * Get the Item that this Block should drop when harvested.
 */
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
    return rand.nextInt(8) == 0 ? Items.WHEAT_SEEDS : Items.field_190931_a;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:8,代碼來源:BlockTallGrass.java

示例11: drawSlot

import net.minecraft.init.Items; //導入方法依賴的package包/類
protected void drawSlot(int entryID, int insideLeft, int yPos, int insideSlotHeight, int mouseXIn, int mouseYIn)
{
    FlatLayerInfo flatlayerinfo = (FlatLayerInfo)GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().get(GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - entryID - 1);
    IBlockState iblockstate = flatlayerinfo.getLayerMaterial();
    Block block = iblockstate.getBlock();
    Item item = Item.getItemFromBlock(block);

    if (item == Items.field_190931_a)
    {
        if (block != Blocks.WATER && block != Blocks.FLOWING_WATER)
        {
            if (block == Blocks.LAVA || block == Blocks.FLOWING_LAVA)
            {
                item = Items.LAVA_BUCKET;
            }
        }
        else
        {
            item = Items.WATER_BUCKET;
        }
    }

    ItemStack itemstack = new ItemStack(item, 1, item.getHasSubtypes() ? block.getMetaFromState(iblockstate) : 0);
    String s = item.getItemStackDisplayName(itemstack);
    this.drawItem(insideLeft, yPos, itemstack);
    GuiCreateFlatWorld.this.fontRendererObj.drawString(s, insideLeft + 18 + 5, yPos + 3, 16777215);
    String s1;

    if (entryID == 0)
    {
        s1 = I18n.format("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
    }
    else if (entryID == GuiCreateFlatWorld.this.theFlatGeneratorInfo.getFlatLayers().size() - 1)
    {
        s1 = I18n.format("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
    }
    else
    {
        s1 = I18n.format("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(flatlayerinfo.getLayerCount())});
    }

    GuiCreateFlatWorld.this.fontRendererObj.drawString(s1, insideLeft + 2 + 213 - GuiCreateFlatWorld.this.fontRendererObj.getStringWidth(s1), yPos + 3, 16777215);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:44,代碼來源:GuiCreateFlatWorld.java


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