本文整理汇总了Java中net.minecraft.init.Blocks.diamond_ore方法的典型用法代码示例。如果您正苦于以下问题:Java Blocks.diamond_ore方法的具体用法?Java Blocks.diamond_ore怎么用?Java Blocks.diamond_ore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.diamond_ore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dropBlockAsItemWithChance
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
* Spawns this Block's drops into the World as EntityItems.
*/
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune)
{
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
if (this.getItemDropped(state, worldIn.rand, fortune) != Item.getItemFromBlock(this))
{
int i = 0;
if (this == Blocks.coal_ore)
{
i = MathHelper.getRandomIntegerInRange(worldIn.rand, 0, 2);
}
else if (this == Blocks.diamond_ore)
{
i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7);
}
else if (this == Blocks.emerald_ore)
{
i = MathHelper.getRandomIntegerInRange(worldIn.rand, 3, 7);
}
else if (this == Blocks.lapis_ore)
{
i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
}
else if (this == Blocks.quartz_ore)
{
i = MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5);
}
this.dropXpOnBlockBreak(worldIn, pos, i);
}
}
示例2: canHarvestBlock
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
* Check whether this Item can harvest the given Block
*/
public boolean canHarvestBlock(Block blockIn)
{
return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock ? true : (blockIn.getMaterial() == Material.iron ? true : blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
}
示例3: getItemDropped
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(IBlockState state, Random rand, int fortune)
{
return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this)))));
}
示例4: getItemOreFromBlockOre
import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public ItemStack getItemOreFromBlockOre(Block block) {
if(block == TechnicalBlock.BorniteOre)
return new ItemStack(TechnicalItem.BorniteItemOre);
if(block == TechnicalBlock.ChalcopyriteOre)
return new ItemStack(TechnicalItem.ChalcopyriteItemOre);
if(block == TechnicalBlock.MalachiteOre)
return new ItemStack(TechnicalItem.MalachiteItemOre);
if(block == TechnicalBlock.PyrolusiteOre)
return new ItemStack(TechnicalItem.PyrolusiteItemOre);
if(block == TechnicalBlock.DolomiteOre)
return new ItemStack(TechnicalItem.DolomiteItemOre);
if(block == TechnicalBlock.MagnesiteOre)
return new ItemStack(TechnicalItem.MagnesiteItemOre);
if(block == TechnicalBlock.HematiteOre1)
return new ItemStack(TechnicalItem.HematiteItemOre1);
if(block == TechnicalBlock.HematiteOre2)
return new ItemStack(TechnicalItem.HematiteItemOre2);
if(block == TechnicalBlock.MagnetiteOre)
return new ItemStack(TechnicalItem.MagnetiteItemOre);
if(block == TechnicalBlock.AcanthiteOre)
return new ItemStack(TechnicalItem.AcanthiteItemOre);
if(block == TechnicalBlock.ChalcociteOre)
return new ItemStack(TechnicalItem.ChalcociteItemOre);
if(block == TechnicalBlock.ColumbiteOre)
return new ItemStack(TechnicalItem.ColumbiteItemOre);
if(block == TechnicalBlock.ScheeliteOre)
return new ItemStack(TechnicalItem.ScheeliteItemOre);
if(block == TechnicalBlock.WolframiteOre)
return new ItemStack(TechnicalItem.WolframiteItemOre);
if(block == TechnicalBlock.ChromiteOre)
return new ItemStack(TechnicalItem.ChromiteItemOre);
if(block == TechnicalBlock.UrainiteOre)
return new ItemStack(TechnicalItem.UrainiteItemOre);
if(block == TechnicalBlock.TantaliteOre)
return new ItemStack(TechnicalItem.TantaliteItemOre);
if(block == TechnicalBlock.CassiteriteOre)
return new ItemStack(TechnicalItem.CassiteriteItemOre);
if(block == TechnicalBlock.CinnabarOre)
return new ItemStack(TechnicalItem.CinnabarItemOre);
if(block == TechnicalBlock.CobaltiteOre)
return new ItemStack(TechnicalItem.CobaltiteItemOre);
if(block == TechnicalBlock.GalenaOre)
return new ItemStack(TechnicalItem.GalenaItemOre);
if(block == TechnicalBlock.MolybdeniteOre)
return new ItemStack(TechnicalItem.MolybdeniteItemOre);
if(block == TechnicalBlock.PentlanditeOre)
return new ItemStack(TechnicalItem.PentlanditeItemOre);
if(block == TechnicalBlock.SphaleriteOre)
return new ItemStack(TechnicalItem.SphaleriteItemOre);
if(block == TechnicalBlock.BaryteOre)
return new ItemStack(TechnicalItem.BaryteItemOre);
if(block == TechnicalBlock.BauxiteOre)
return new ItemStack(TechnicalItem.BauxiteItemOre);
if(block == TechnicalBlock.BerylOre)
return new ItemStack(TechnicalItem.BerylItemOre);
if(block == TechnicalBlock.SperryliteOre)
return new ItemStack(TechnicalItem.SperryliteItemOre);
if(block == TechnicalBlock.IlmeniteOre)
return new ItemStack(TechnicalItem.IlmeniteItemOre);
if(block == TechnicalBlock.ColtanBlock)
return new ItemStack(TechnicalItem.ColtanItemOre);
if(block == Blocks.coal_ore)
return new ItemStack(TechnicalItem.CoalItemOre);
if(block == Blocks.redstone_ore)
return new ItemStack(TechnicalItem.RedstoneItemOre);
if(block == Blocks.gold_ore)
return new ItemStack(TechnicalItem.GoldItemOre);
if(block == Blocks.lapis_ore)
return new ItemStack(TechnicalItem.LapisItemOre);
if(block == Blocks.diamond_ore)
return new ItemStack(TechnicalItem.DiamondItemOre);
if(block == Blocks.emerald_ore)
return new ItemStack(TechnicalItem.EmeraldItemOre);
return null;
}