Search in sources :

Example 1 with AIRobotGotoSleep

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

the class BoardRobotPlanter method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotPlant(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotPlant) {
        releaseBlockFound();
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotPlant(buildcraft.robotics.ai.AIRobotPlant) AIRobotFetchAndEquipItemStack(buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)

Example 2 with AIRobotGotoSleep

use of buildcraft.robotics.ai.AIRobotGotoSleep 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)

Example 3 with AIRobotGotoSleep

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

the class BoardRobotFarmer method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotUseToolOnBlock(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotUseToolOnBlock) {
        releaseBlockFound();
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotUseToolOnBlock(buildcraft.robotics.ai.AIRobotUseToolOnBlock) AIRobotFetchAndEquipItemStack(buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)

Example 4 with AIRobotGotoSleep

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

the class BoardRobotPump method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotPumpBlock(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotPumpBlock) {
        releaseBlockFound();
    } else if (ai instanceof AIRobotGotoStationAndUnloadFluids) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotGotoStationAndUnloadFluids(buildcraft.robotics.ai.AIRobotGotoStationAndUnloadFluids) AIRobotPumpBlock(buildcraft.robotics.ai.AIRobotPumpBlock)

Example 5 with AIRobotGotoSleep

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

the class BoardRobotStripes method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    if (ai instanceof AIRobotSearchAndGotoBlock) {
        if (ai.success()) {
            blockFound = ((AIRobotSearchAndGotoBlock) ai).getBlockFound();
            startDelegateAI(new AIRobotStripesHandler(robot, blockFound));
        } else {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotFetchAndEquipItemStack) {
        if (!ai.success()) {
            startDelegateAI(new AIRobotGotoSleep(robot));
        }
    } else if (ai instanceof AIRobotStripesHandler) {
        releaseBlockFound();
    }
}
Also used : AIRobotSearchAndGotoBlock(buildcraft.robotics.ai.AIRobotSearchAndGotoBlock) AIRobotGotoSleep(buildcraft.robotics.ai.AIRobotGotoSleep) AIRobotStripesHandler(buildcraft.robotics.ai.AIRobotStripesHandler) AIRobotFetchAndEquipItemStack(buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)

Aggregations

AIRobotGotoSleep (buildcraft.robotics.ai.AIRobotGotoSleep)6 AIRobotSearchAndGotoBlock (buildcraft.robotics.ai.AIRobotSearchAndGotoBlock)4 AIRobotFetchAndEquipItemStack (buildcraft.robotics.ai.AIRobotFetchAndEquipItemStack)3 AIRobotGotoStationAndLoad (buildcraft.robotics.ai.AIRobotGotoStationAndLoad)2 ArrayStackFilter (buildcraft.lib.inventory.filter.ArrayStackFilter)1 AIRobotDeliverRequested (buildcraft.robotics.ai.AIRobotDeliverRequested)1 AIRobotDisposeItems (buildcraft.robotics.ai.AIRobotDisposeItems)1 AIRobotGotoBlock (buildcraft.robotics.ai.AIRobotGotoBlock)1 AIRobotGotoStationAndUnloadFluids (buildcraft.robotics.ai.AIRobotGotoStationAndUnloadFluids)1 AIRobotPlant (buildcraft.robotics.ai.AIRobotPlant)1 AIRobotPumpBlock (buildcraft.robotics.ai.AIRobotPumpBlock)1 AIRobotRecharge (buildcraft.robotics.ai.AIRobotRecharge)1 AIRobotSearchStackRequest (buildcraft.robotics.ai.AIRobotSearchStackRequest)1 AIRobotStripesHandler (buildcraft.robotics.ai.AIRobotStripesHandler)1 AIRobotUseToolOnBlock (buildcraft.robotics.ai.AIRobotUseToolOnBlock)1