Search in sources :

Example 1 with AIRobotGotoBlock

use of buildcraft.robotics.ai.AIRobotGotoBlock in project LogisticsPipes by RS485.

the class LogisticsRoutingBoardRobot method delegateAIEnded.

@Override
public void delegateAIEnded(AIRobot ai) {
    super.delegateAIEnded(ai);
    if (ai instanceof AIRobotGotoBlock) {
        if (!ai.success()) {
            dropAndClear();
            startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
        } else {
            startDelegateAI(new AIRobotStraightMoveTo(robot, (float) targetStationPos.getXCoord() + 0.5F + targetStationSide.offsetX * 0.5F, (float) targetStationPos.getYCoord() + 0.5F + targetStationSide.offsetY * 0.5F, (float) targetStationPos.getZCoord() + 0.5F + targetStationSide.offsetZ * 0.5F));
        }
    } else if (ai instanceof AIRobotStraightMoveTo) {
        if (!ai.success()) {
            dropAndClear();
            startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
        } else {
            insertIntoPipe();
        }
    } else if (ai instanceof ItemInsertionAIRobot) {
        for (int i = 0; i < robot.getSizeInventory(); i++) {
            robot.setInventorySlotContents(i, null);
        }
        if (!ai.success()) {
            dropAndClear();
        } else {
            items.clear();
        }
        startDelegateAI(new AIRobotGotoStation(robot, robot.getLinkedStation()));
        targetStationPos = null;
    }
}
Also used : ItemInsertionAIRobot(logisticspipes.proxy.buildcraft.robots.ai.ItemInsertionAIRobot) AIRobotStraightMoveTo(buildcraft.robotics.ai.AIRobotStraightMoveTo) AIRobotGotoStation(buildcraft.robotics.ai.AIRobotGotoStation) AIRobotGotoBlock(buildcraft.robotics.ai.AIRobotGotoBlock)

Example 2 with AIRobotGotoBlock

use of buildcraft.robotics.ai.AIRobotGotoBlock in project LogisticsPipes by RS485.

the class LogisticsRoutingBoardRobot method startTransport.

private void startTransport(LogisticsRoutingBoardRobot target, DockingStation station) {
    acceptsItems = false;
    targetStationPos = new DoubleCoordinates(station.x(), station.y(), station.z());
    targetStationSide = station.side();
    startDelegateAI(new AIRobotGotoBlock(robot, station.x() + station.side().offsetX, station.y() + station.side().offsetY, station.z() + station.side().offsetZ));
}
Also used : DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) AIRobotGotoBlock(buildcraft.robotics.ai.AIRobotGotoBlock)

Aggregations

AIRobotGotoBlock (buildcraft.robotics.ai.AIRobotGotoBlock)2 AIRobotGotoStation (buildcraft.robotics.ai.AIRobotGotoStation)1 AIRobotStraightMoveTo (buildcraft.robotics.ai.AIRobotStraightMoveTo)1 ItemInsertionAIRobot (logisticspipes.proxy.buildcraft.robots.ai.ItemInsertionAIRobot)1 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)1