use of logisticspipes.interfaces.routing.IItemSpaceControl in project LogisticsPipes by RS485.
the class ModuleCrafter method cacheAreAllOrderesToBuffer.
public void cacheAreAllOrderesToBuffer() {
final IPipeServiceProvider service = _service;
if (service == null)
return;
boolean result = true;
for (LogisticsItemOrder order : service.getItemOrderManager()) {
if (order.getDestination() instanceof IItemSpaceControl) {
SinkReply reply = LogisticsManager.canSink(order.getResource().stack.makeNormalStack(), order.getDestination().getRouter(), null, true, order.getResource().getItem(), null, true, false);
if (reply != null && reply.bufferMode == BufferMode.NONE && reply.maxNumberOfItems >= 1) {
result = false;
break;
}
} else {
// No Space control
result = false;
break;
}
}
cachedAreAllOrderesToBuffer = result;
}
Aggregations