return (_modules[slot] != null);
}
@Override
public SinkReply sinksItem(ItemIdentifier item, int bestPriority, int bestCustomPriority, boolean allowDefault, boolean includeInTransit) {
SinkReply bestresult = null;
for (LogisticsModule module : _modules){
if (module != null){
SinkReply result = module.sinksItem(item, bestPriority, bestCustomPriority, allowDefault, includeInTransit);
if (result != null) {
bestresult = result;
bestPriority = result.fixedPriority.ordinal();
bestCustomPriority = result.customPriority;
}
}
}
if (bestresult == null) return null;
//Always deny items when we can't put the item anywhere
IInventoryUtil invUtil = _parentPipe.getSneakyInventory(false);
if (invUtil == null) return null;
int roomForItem = invUtil.roomForItem(item);
if (roomForItem < 1) return null;
if(includeInTransit) {
int onRoute = _parentPipe.countOnRoute(item);
roomForItem = invUtil.roomForItem(item, onRoute + item.getMaxStackSize());
roomForItem -= onRoute;
if (roomForItem < 1) return null;
}
if(bestresult.maxNumberOfItems == 0) {
return new SinkReply(bestresult, roomForItem);
}
return new SinkReply(bestresult, Math.min(bestresult.maxNumberOfItems, roomForItem));
}