mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 15:03:01 +00:00
Add a public isEffective to HarvestTool. Allows outside checking whether a tool is effective vs. a material.
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user