Move DualHarvest speed calc also into AbilityHelper

This commit is contained in:
Bernhard Bonigl committed 2014-10-28 17:56:09 +01:00
1 parent 5495722194
commit e6469587fe
2 files changed
+20 -20

No files matched your search

@@ -699,6 +699,22 @@ public class AbilityHelper
return trueSpeed;
}
public static float calcDualToolSpeed (ToolCore tool, NBTTagCompound tags, boolean secondary)
{
String tag = "MiningSpeed";
if(secondary) tag += "2";
float mineSpeed = tags.getInteger(tag);
float speedMod = 1f;
if (tool instanceof HarvestTool)
speedMod = ((HarvestTool) tool).breakSpeedModifier();
float trueSpeed = mineSpeed / 100f * speedMod;
trueSpeed += calcStoneboundBonus(tool, tags);
return trueSpeed;
}
public static float calcStoneboundBonus (ToolCore tool, NBTTagCompound tags)
{
int durability = tags.getInteger("Damage");