Search in sources :

Example 1 with AIRobotSearchStackRequest

use of buildcraft.robotics.ai.AIRobotSearchStackRequest in project BuildCraft by BuildCraft.

the class BoardRobotDelivery method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchStackRequest) {
        if (!ai.success()) {
            deliveryBlacklist.clear();
            startDelegateAI(new AIRobotGotoSleep(robot));
        } else {
            currentRequest = ((AIRobotSearchStackRequest) ai).request;
            if (!currentRequest.getStation(robot.worldObj).take(robot)) {
                releaseCurrentRequest();
            }
        }
    } else if (ai instanceof AIRobotGotoStationAndLoad) {
        if (!ai.success()) {
            deliveryBlacklist.add(currentRequest.getStack());
            releaseCurrentRequest();
        } else {
            startDelegateAI(new AIRobotDeliverRequested(robot, currentRequest));
        }
    } else if (ai instanceof AIRobotDeliverRequested) {
        releaseCurrentRequest();
    }
}
Also used : AIRobotGotoStationAndLoad(buildcraft.robotics.ai.AIRobotGotoStationAndLoad) AIRobotSearchStackRequest(buildcraft.robotics.ai.AIRobotSearchStackRequest) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotDeliverRequested(buildcraft.robotics.ai.AIRobotDeliverRequested)

Aggregations

AIRobotDeliverRequested (buildcraft.robotics.ai.AIRobotDeliverRequested)1 AIRobotGotoSleep (buildcraft.robotics.ai.AIRobotGotoSleep)1 AIRobotGotoStationAndLoad (buildcraft.robotics.ai.AIRobotGotoStationAndLoad)1 AIRobotSearchStackRequest (buildcraft.robotics.ai.AIRobotSearchStackRequest)1