use of com.minecolonies.coremod.colony.jobs.JobMiner in project minecolonies by Minecolonies.
the class WalkToProxy method fillProxyList.
/**
* Calculates a list of proxies to a certain target for a worker.
*
* @param target the target.
* @param distanceToPath the complete distance.
* @return the first position to path to.
*/
@NotNull
private BlockPos fillProxyList(@NotNull final BlockPos target, final double distanceToPath) {
final BlockPos proxyPoint;
final AbstractBuildingWorker building = worker.getWorkBuilding();
if (worker.getColonyJob() != null && worker.getColonyJob() instanceof JobMiner && building instanceof BuildingMiner) {
proxyPoint = getMinerProxy(target, distanceToPath, (BuildingMiner) building);
} else {
proxyPoint = getProxy(target, worker.getPosition(), distanceToPath);
}
if (!proxyList.isEmpty()) {
proxyList.remove(0);
}
return proxyPoint;
}
Aggregations