本文整理匯總了Java中net.minecraft.init.Blocks.emerald_ore方法的典型用法代碼示例。如果您正苦於以下問題:Java Blocks.emerald_ore方法的具體用法?Java Blocks.emerald_ore怎麽用?Java Blocks.emerald_ore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.init.Blocks
的用法示例。
在下文中一共展示了Blocks.emerald_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;
}