Search in sources :

Example 1 with StackRequest

use of buildcraft.robotics.StackRequest in project BuildCraft by BuildCraft.

the class AIRobotSearchStackRequest method getAvailableRequests.

private Collection<StackRequest> getAvailableRequests(DockingStation station) {
    List<StackRequest> result = new ArrayList<>();
    IRequestProvider provider = station.getRequestProvider();
    if (provider == null) {
        return result;
    }
    for (int i = 0; i < provider.getRequestsCount(); i++) {
        if (provider.getRequest(i) == null) {
            continue;
        }
        StackRequest req = new StackRequest(provider, i, provider.getRequest(i));
        req.setStation(station);
        if (!robot.getRegistry().isTaken(req.getResourceId(robot.worldObj))) {
            result.add(req);
        }
    }
    return result;
}
Also used : IRequestProvider(buildcraft.api.robots.IRequestProvider) ArrayList(java.util.ArrayList) StackRequest(buildcraft.robotics.StackRequest)

Aggregations

IRequestProvider (buildcraft.api.robots.IRequestProvider)1 StackRequest (buildcraft.robotics.StackRequest)1 ArrayList (java.util.ArrayList)1