if (path == null && pathSearch == null) {
pathSearch = new PathFinding(robot.worldObj, new BlockIndex((int) Math.floor(robot.posX),
(int) Math.floor(robot.posY), (int) Math.floor(robot.posZ)), new BlockIndex(
(int) Math.floor(finalX), (int) Math.floor(finalY), (int) Math.floor(finalZ)), maxDistance);
pathSearchJob = new PathFindingJob(pathSearch, 100);
pathSearchJob.start();
} else if (path != null) {
double distance = robot.getDistance(nextX, nextY, nextZ);
if (!robot.isMoving() || distance > prevDistance) {