Java Code Examples for net.minecraft.init.Blocks.diamond_ore()

The following are Jave code examples for showing how to use diamond_ore() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: BlockOre.java   View Source Code Vote up 5 votes
/**
 * 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);
    }
}
 
Example 2
Project: DecompiledMinecraft   File: BlockOre.java   View Source Code Vote up 5 votes
/**
 * 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);
    }
}
 
Example 3
Project: BaseClient   File: BlockOre.java   View Source Code Vote up 5 votes
/**
 * 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);
    }
}
 
Example 4
Project: BaseClient   File: BlockOre.java   View Source Code Vote up 5 votes
/**
 * 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);
    }
}
 
Example 5
Project: DecompiledMinecraft   File: ItemPickaxe.java   View Source Code Vote up 4 votes
/**
 * 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);
}
 
Example 6
Project: DecompiledMinecraft   File: BlockOre.java   View Source Code Vote up 4 votes
/**
 * 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)))));
}
 
Example 7
Project: DecompiledMinecraft   File: ItemPickaxe.java   View Source Code Vote up 4 votes
/**
 * 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);
}
 
Example 8
Project: DecompiledMinecraft   File: BlockOre.java   View Source Code Vote up 4 votes
/**
 * 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)))));
}
 
Example 9
Project: BaseClient   File: ItemPickaxe.java   View Source Code Vote up 4 votes
/**
 * 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);
}
 
Example 10
Project: BaseClient   File: BlockOre.java   View Source Code Vote up 4 votes
/**
 * 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)))));
}
 
Example 11
Project: BaseClient   File: ItemPickaxe.java   View Source Code Vote up 4 votes
/**
 * 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);
}
 
Example 12
Project: BaseClient   File: BlockOre.java   View Source Code Vote up 4 votes
/**
 * 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)))));
}
 
Example 13
Project: Technical   File: TileEntityMachineMiner.java   View Source Code Vote up 4 votes
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;
}