Search in sources :

Example 1 with IRobotRegistry

use of buildcraft.api.robots.IRobotRegistry in project BuildCraft by BuildCraft.

the class ActionRobotGotoStation method actionActivate.

@Override
public void actionActivate(IStatementContainer container, IStatementParameter[] parameters) {
    IRobotRegistry registry = RobotManager.registryProvider.getRegistry(container.getTile().getWorld());
    List<DockingStation> stations = RobotUtils.getStations(container.getTile());
    for (DockingStation station : stations) {
        if (station.robotTaking() != null) {
            EntityRobot robot = (EntityRobot) station.robotTaking();
            AIRobot ai = robot.getOverridingAI();
            if (ai != null) {
                continue;
            }
            DockingStation newStation = station;
            if (parameters[0] != null) {
                newStation = getStation((StatementParameterItemStack) parameters[0], registry);
            }
            if (newStation != null) {
                robot.overrideAI(new AIRobotGoAndLinkToDock(robot, newStation));
            }
        }
    }
}
Also used : AIRobotGoAndLinkToDock(buildcraft.robotics.ai.AIRobotGoAndLinkToDock) DockingStation(buildcraft.api.robots.DockingStation) EntityRobot(buildcraft.robotics.EntityRobot) IRobotRegistry(buildcraft.api.robots.IRobotRegistry) StatementParameterItemStack(buildcraft.api.statements.StatementParameterItemStack) AIRobot(buildcraft.api.robots.AIRobot)

Example 2 with IRobotRegistry

use of buildcraft.api.robots.IRobotRegistry in project BuildCraft by BuildCraft.

the class StackRequest method getStation.

public DockingStation getStation(World world) {
    if (station == null) {
        IRobotRegistry robotRegistry = RobotManager.registryProvider.getRegistry(world);
        station = robotRegistry.getStation(stationIndex, stationSide);
    }
    return station;
}
Also used : IRobotRegistry(buildcraft.api.robots.IRobotRegistry)

Aggregations

IRobotRegistry (buildcraft.api.robots.IRobotRegistry)2 AIRobot (buildcraft.api.robots.AIRobot)1 DockingStation (buildcraft.api.robots.DockingStation)1 StatementParameterItemStack (buildcraft.api.statements.StatementParameterItemStack)1 EntityRobot (buildcraft.robotics.EntityRobot)1 AIRobotGoAndLinkToDock (buildcraft.robotics.ai.AIRobotGoAndLinkToDock)1