TileEntity nearbyTile = robot.worldObj.getTileEntity(station.x() + dir.offsetX, station.y()
+ dir.offsetY, station.z()
+ dir.offsetZ);
if (nearbyTile instanceof IRequestProvider) {
IRequestProvider provider = (IRequestProvider) nearbyTile;
for (int i = 0; i < provider.getNumberOfRequests(); ++i) {
StackRequest requestFound = provider.getAvailableRequest(i);
if (requestFound != null
&& !isBlacklisted(requestFound.stack)
&& filter.matches(requestFound.stack)) {
requestFound.station = station;
if (take) {
if (provider.takeRequest(i, robot)) {
return requestFound;
}
} else {
return requestFound;
}