Search in sources :

Example 6 with WorkOrderBuildMiner

use of com.minecolonies.coremod.colony.workorders.WorkOrderBuildMiner in project minecolonies by ldtteam.

the class BuildingMiner method searchWorkOrder.

@Override
public void searchWorkOrder() {
    final ICitizenData citizen = getFirstModuleOccurance(WorkerBuildingModule.class).getFirstCitizen();
    if (citizen == null) {
        return;
    }
    final List<WorkOrderBuildMiner> list = getColony().getWorkManager().getOrderedList(WorkOrderBuildMiner.class, getPosition());
    for (final WorkOrderBuildMiner wo : list) {
        if (this.getID().equals(wo.getMinerBuilding())) {
            citizen.getJob(JobMiner.class).setWorkOrder(wo);
            wo.setClaimedBy(citizen);
            return;
        }
    }
}
Also used : JobMiner(com.minecolonies.coremod.colony.jobs.JobMiner) WorkerBuildingModule(com.minecolonies.coremod.colony.buildings.modules.WorkerBuildingModule) ICitizenData(com.minecolonies.api.colony.ICitizenData) WorkOrderBuildMiner(com.minecolonies.coremod.colony.workorders.WorkOrderBuildMiner)

Aggregations

WorkOrderBuildMiner (com.minecolonies.coremod.colony.workorders.WorkOrderBuildMiner)6 ICitizenData (com.minecolonies.api.colony.ICitizenData)2 WorkerBuildingModule (com.minecolonies.coremod.colony.buildings.modules.WorkerBuildingModule)2 ArrayList (java.util.ArrayList)2 NotNull (org.jetbrains.annotations.NotNull)2 IBuilding (com.minecolonies.api.colony.buildings.IBuilding)1 IWorkManager (com.minecolonies.api.colony.workorders.IWorkManager)1 IWorkOrder (com.minecolonies.api.colony.workorders.IWorkOrder)1 JobBuilder (com.minecolonies.coremod.colony.jobs.JobBuilder)1 JobMiner (com.minecolonies.coremod.colony.jobs.JobMiner)1 WorkOrderBuild (com.minecolonies.coremod.colony.workorders.WorkOrderBuild)1 WorkOrderBuildDecoration (com.minecolonies.coremod.colony.workorders.WorkOrderBuildDecoration)1 WorkOrderBuildRemoval (com.minecolonies.coremod.colony.workorders.WorkOrderBuildRemoval)1 Level (com.minecolonies.coremod.entity.ai.citizen.miner.Level)1 ColonyViewWorkOrderMessage (com.minecolonies.coremod.network.messages.client.colony.ColonyViewWorkOrderMessage)1 HashSet (java.util.HashSet)1 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)1