Skip to content

Commit

Permalink
Add correct isEffective implementation to DualHarvestTool.
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Aug 13, 2014
1 parent 3c218e2 commit 8f5d065
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/main/java/tconstruct/library/tools/DualHarvestTool.java
Expand Up @@ -111,20 +111,9 @@ public float getDigSpeed (ItemStack stack, Block block, int meta)
public boolean func_150897_b (Block block)
{
if (block.getMaterial().isToolNotRequired())
{
return true;
}
for (Material m : getEffectiveMaterials())
{
if (m == block.getMaterial())
return true;
}
for (Material m : getEffectiveSecondaryMaterials())
{
if (m == block.getMaterial())
return true;
}
return false;

return isEffective(block.getMaterial());
}

@Override
Expand All @@ -133,6 +122,18 @@ public boolean canHarvestBlock (Block block, ItemStack itemStack)
return func_150897_b(block);
}

@Override
public boolean isEffective(Material material) {
if(super.isEffective(material))
return true;

for(Material m : getEffectiveSecondaryMaterials())
if(m == material)
return true;

return false;
}

@Override
public String[] getTraits ()
{
Expand Down

0 comments on commit 8f5d065

Please sign in to comment.