Add a public isEffective to HarvestTool. Allows outside checking whether a tool is effective vs. a material.

This commit is contained in:
Bernhard Bonigl committed 2014-07-15 21:18:09 +02:00
1 parent 313b49181f
commit 92f6e1405f
1 file changed
+10 -6
@@ -90,12 +90,7 @@ public abstract class HarvestTool extends ToolCore
{
return true;
}
for (Material m : getEffectiveMaterials())
{
if (m == block.getMaterial())
return true;
}
return false;
return isEffective(block.getMaterial());
}
@Override
@@ -114,6 +109,15 @@ public abstract class HarvestTool extends ToolCore
protected abstract String getHarvestType ();
public boolean isEffective(Material material)
{
for(Material m : getEffectiveMaterials())
if(m == material)
return true;
return false;
}
//Right-click
@Override
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ)