mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
Merge pull request #747 from bonii-xx/master
Change harvest speed calculation to be accessible from subtypes.
This commit is contained in:
commit
beffc0b162
1 file changed
+11
-7
@@ -49,7 +49,7 @@ public abstract class HarvestTool extends ToolCore
|
||||
return super.getDigSpeed(stack, block, meta);
|
||||
}
|
||||
|
||||
float calculateStrength (NBTTagCompound tags, Block block, int meta)
|
||||
public float calculateStrength (NBTTagCompound tags, Block block, int meta)
|
||||
{
|
||||
float mineSpeed = tags.getInteger("MiningSpeed");
|
||||
int heads = 1;
|
||||
@@ -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