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));
}
}
}
}
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;
}
Aggregations