Search in sources :

Example 1 with IItemSpaceControl

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;
}
Also used : IItemSpaceControl(logisticspipes.interfaces.routing.IItemSpaceControl) SinkReply(logisticspipes.utils.SinkReply) IPipeServiceProvider(logisticspipes.interfaces.IPipeServiceProvider) LogisticsItemOrder(logisticspipes.routing.order.LogisticsItemOrder)

Aggregations

IPipeServiceProvider (logisticspipes.interfaces.IPipeServiceProvider)1 IItemSpaceControl (logisticspipes.interfaces.routing.IItemSpaceControl)1 LogisticsItemOrder (logisticspipes.routing.order.LogisticsItemOrder)1 SinkReply (logisticspipes.utils.SinkReply)1