public void updatePath() { if (thread == null && getLink() != null && lastCalcTime <= 0) { pathfinder = null; Vector3 start = getPosition(); Vector3 target = new Vector3(getLink().x(), getLink().y(), getLink().z()); if (start.distance(target) < Settings.MAX_LEVITATOR_DISTANCE) { if (canBeMovePath(world(), start) && canBeMovePath(world(), target)) { thread = new ThreadLevitatorPathfinding(new PathfinderLevitator(world(), target), start); thread.start(); lastCalcTime = 40; } } } }