Java Code Examples for net.minecraft.init.Blocks#gold_ore()

The following examples show how to use net.minecraft.init.Blocks#gold_ore() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: Artifacts   File: ComponentMining.java    License: MIT License 6 votes vote down vote up
@Override
public boolean canHarvestBlock(Block block, ItemStack itemStack) {
	ToolMaterial toolMaterial = ToolMaterial.values()[itemStack.stackTagCompound.getInteger("material")];
	
	if(toolMaterial == toolMaterial.WOOD) {
		return Items.wooden_pickaxe.func_150897_b/*canHarvestBlock*/(block);
	}
	else if(toolMaterial == toolMaterial.STONE) {
		return Items.stone_pickaxe.func_150897_b(block);
	}
	else if(toolMaterial == ToolMaterial.EMERALD) {
		return Items.diamond_pickaxe.func_150897_b(block);
	}
	else if(toolMaterial == ToolMaterial.IRON) {
		return Items.iron_pickaxe.func_150897_b(block);
	}
	else if(toolMaterial == ToolMaterial.GOLD) {
		return Items.golden_pickaxe.func_150897_b(block);
	}
	return block == Blocks.obsidian ? toolMaterial.getHarvestLevel() == 3 : (block != Blocks.diamond_block && block != Blocks.diamond_ore ? (block != Blocks.emerald_ore && block != Blocks.emerald_block ? (block != Blocks.gold_block && block != Blocks.gold_ore ? (block != Blocks.iron_block && block != Blocks.iron_ore ? (block != Blocks.lapis_block && block != Blocks.lapis_ore ? (block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore ? (block.getMaterial() == Material.rock ? true : (block.getMaterial() == Material.iron ? true : block.getMaterial() == Material.anvil)) : toolMaterial.getHarvestLevel() >= 2) : toolMaterial.getHarvestLevel() >= 1) : toolMaterial.getHarvestLevel() >= 1) : toolMaterial.getHarvestLevel() >= 2) : toolMaterial.getHarvestLevel() >= 2) : toolMaterial.getHarvestLevel() >= 2);
}
 
Example 2
Source Project: Artifacts   File: ComponentHarvesting.java    License: MIT License 6 votes vote down vote up
@Override
public boolean onBlockDestroyed(ItemStack itemStack, World world, Block block, int x, int y, int z, EntityLivingBase player) {
	if (block != Blocks.coal_ore && block != Blocks.iron_ore && block != Blocks.emerald_ore && block != Blocks.gold_ore && block != Blocks.diamond_ore && block != Blocks.quartz_ore && block != Blocks.lapis_ore && block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore)
	{
		return false;
       }
	else if(world.rand.nextInt(4) == 0) {
		//drop another
		/*ItemStack is = new ItemStack(Block.blocksList[blockID], 1);
		EntityItem ei = new EntityItem(world, x, y, z, is);
		world.spawnEntityInWorld(ei);*/
		itemStack.damageItem(1, player);
		block.dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
	}
	return true;
}
 
Example 3
Source Project: Artifacts   File: ComponentHarvesting.java    License: MIT License 5 votes vote down vote up
@Override
public float getDigSpeed(ItemStack itemStack, Block block, int meta) {
	if (block != Blocks.coal_ore && block != Blocks.iron_ore && block != Blocks.emerald_ore && block != Blocks.gold_ore && block != Blocks.diamond_ore && block != Blocks.quartz_ore && block != Blocks.lapis_ore && block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore)
       {
		return -1;
       }
	else {
		return (ToolMaterial.values()[itemStack.stackTagCompound.getInteger("material")].getEfficiencyOnProperMaterial() / 2);
		//return 15;
	}
}
 
Example 4
Source Project: Artifacts   File: ComponentHarvesting.java    License: MIT License 5 votes vote down vote up
@Override
public boolean canHarvestBlock(Block block, ItemStack itemStack) {
	if (block != Blocks.coal_ore && block != Blocks.iron_ore && block != Blocks.emerald_ore && block != Blocks.gold_ore && block != Blocks.diamond_ore && block != Blocks.quartz_ore && block != Blocks.lapis_ore && block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore)
    {
		return false;
       }
	else {
		return true;
	}
}