Skip to content

Commit

Permalink
Add a public isEffective to HarvestTool. Allows outside checking whet…
Browse files Browse the repository at this point in the history
…her a tool is effective vs. a material.
  • Loading branch information
bonii-xx committed Jul 15, 2014
1 parent 313b491 commit 92f6e14
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/java/tconstruct/library/tools/HarvestTool.java
Expand Up @@ -90,12 +90,7 @@ public boolean func_150897_b (Block block)
{
return true;
}
for (Material m : getEffectiveMaterials())
{
if (m == block.getMaterial())
return true;
}
return false;
return isEffective(block.getMaterial());
}

@Override
Expand All @@ -114,6 +109,15 @@ public String[] getTraits ()

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)
Expand Down

0 comments on commit 92f6e14

Please sign in to comment.