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