Search in sources :

Example 1 with JobMiner

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;
}
Also used : AbstractBuildingWorker(com.minecolonies.coremod.colony.buildings.AbstractBuildingWorker) JobMiner(com.minecolonies.coremod.colony.jobs.JobMiner) BlockPos(net.minecraft.util.math.BlockPos) BuildingMiner(com.minecolonies.coremod.colony.buildings.BuildingMiner) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

AbstractBuildingWorker (com.minecolonies.coremod.colony.buildings.AbstractBuildingWorker)1 BuildingMiner (com.minecolonies.coremod.colony.buildings.BuildingMiner)1 JobMiner (com.minecolonies.coremod.colony.jobs.JobMiner)1 BlockPos (net.minecraft.util.math.BlockPos)1 NotNull (org.jetbrains.annotations.NotNull)1