*/
public boolean startDigging(Point position, Material tool) {
if (getOwner().getPhysics().getPosition().getDistance(position) > 6) { // TODO: Actually get block reach from somewhere instead of just using 6
return false;
}
VanillaBlockMaterial block = (VanillaBlockMaterial) position.getBlock().getMaterial();
float modifier = 1f, multiplicator = 1.5f;
ToolType type = null;
MiningTool mining = null;
if (tool instanceof MiningTool) {
mining = (MiningTool) tool;
type = mining.getToolType();
}
if (block.isMiningType(type)) {
if (mining != null) {
modifier = mining.getDiggingSpeed();
}
} else {
multiplicator = 5f;
}
byte maxAmount = 8;
separator = ((block.getHardness() * multiplicator) / modifier) / maxAmount;
amount = 0;
timer = 0;
isDigging = true;
diggingPosition = position;