当前位置: 首页>>代码示例>>Java>>正文


Java Blocks.diamond_ore方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:BlockOre.java

示例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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:ItemPickaxe.java

示例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)))));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:BlockOre.java

示例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;
}
 
开发者ID:viddeno,项目名称:Technical,代码行数:76,代码来源:TileEntityMachineMiner.java


注:本文中的net.minecraft.init.Blocks.diamond_ore方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。