use of buildcraft.robotics.ai.AIRobotDeliverRequested 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();
}
}
Aggregations