2013-08-27 00:49:32 +02:00
|
|
|
package mekanism.tools.item;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.item.EnumToolMaterial;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2014-03-01 17:08:32 +01:00
|
|
|
import net.minecraftforge.common.ForgeHooks;
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2012-11-05 20:29:04 +01:00
|
|
|
public class ItemMekanismPaxel extends ItemMekanismTool
|
2012-08-15 22:41:41 +02:00
|
|
|
{
|
2014-03-08 02:00:25 +01:00
|
|
|
public ItemMekanismPaxel(int i, EnumToolMaterial enumtoolmaterial)
|
|
|
|
{
|
|
|
|
super(i, 3, enumtoolmaterial, new Block[256]);
|
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
|
2014-03-08 02:00:25 +01:00
|
|
|
@Override
|
|
|
|
public float getStrVsBlock(ItemStack itemstack, Block block)
|
|
|
|
{
|
|
|
|
return block.blockID != Block.bedrock.blockID ? efficiencyOnProperMaterial : 1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float getStrVsBlock(ItemStack stack, Block block, int meta)
|
|
|
|
{
|
|
|
|
if(ForgeHooks.isToolEffective(stack, block, meta))
|
|
|
|
{
|
|
|
|
return efficiencyOnProperMaterial;
|
|
|
|
}
|
|
|
|
|
|
|
|
return getStrVsBlock(stack, block);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canHarvestBlock(Block block)
|
|
|
|
{
|
|
|
|
if(block == Block.obsidian)
|
|
|
|
{
|
|
|
|
return toolMaterial.getHarvestLevel() == 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(block == Block.blockDiamond || block == Block.oreDiamond)
|
|
|
|
{
|
|
|
|
return toolMaterial.getHarvestLevel() >= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(block == Block.blockGold || block == Block.oreGold)
|
|
|
|
{
|
|
|
|
return toolMaterial.getHarvestLevel() >= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(block == Block.blockIron || block == Block.oreIron)
|
|
|
|
{
|
|
|
|
return toolMaterial.getHarvestLevel() >= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(block == Block.blockLapis || block == Block.oreLapis)
|
|
|
|
{
|
|
|
|
return toolMaterial.getHarvestLevel() >= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(block == Block.oreRedstone || block == Block.oreRedstoneGlowing)
|
|
|
|
{
|
|
|
|
return toolMaterial.getHarvestLevel() >= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(block.blockMaterial == Material.rock)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return block.blockMaterial == Material.iron;
|
|
|
|
}
|
2012-08-15 22:41:41 +02:00
|
|
|
}
|