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