Mekanism-tilera-Edition/common/mekanism/tools/item/ItemMekanismPaxel.java

62 lines
1.6 KiB
Java
Raw Normal View History

package mekanism.tools.item;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemStack;
public class ItemMekanismPaxel extends ItemMekanismTool
{
public ItemMekanismPaxel(int i, EnumToolMaterial enumtoolmaterial)
{
super(i, 3, enumtoolmaterial, new Block[256]);
}
@Override
public float getStrVsBlock(ItemStack itemstack, Block block)
{
return block.blockID != Block.bedrock.blockID ? efficiencyOnProperMaterial : 1.0F;
}
@Override
public boolean canHarvestBlock(Block block)
{
2013-11-14 04:43:58 +01:00
if(block == Block.obsidian)
{
return toolMaterial.getHarvestLevel() == 3;
}
2013-11-14 04:43:58 +01:00
if(block == Block.blockDiamond || block == Block.oreDiamond)
{
return toolMaterial.getHarvestLevel() >= 2;
}
2013-11-14 04:43:58 +01:00
if(block == Block.blockGold || block == Block.oreGold)
{
return toolMaterial.getHarvestLevel() >= 2;
}
2013-11-14 04:43:58 +01:00
if(block == Block.blockIron || block == Block.oreIron)
{
return toolMaterial.getHarvestLevel() >= 1;
}
2013-11-14 04:43:58 +01:00
if(block == Block.blockLapis || block == Block.oreLapis)
{
return toolMaterial.getHarvestLevel() >= 1;
}
2013-11-14 04:43:58 +01:00
if(block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
{
return toolMaterial.getHarvestLevel() >= 2;
}
2013-11-14 04:43:58 +01:00
if(block.blockMaterial == Material.rock)
{
return true;
}
2013-11-14 04:43:58 +01:00
return block.blockMaterial == Material.iron;
}
}