use of logisticspipes.modules.abstractmodules.LogisticsModule in project LogisticsPipes by RS485.
the class LogisticsManager method canSink.
public static SinkReply canSink(IRouter destination, IRouter sourceRouter, boolean excludeSource, ItemIdentifier stack, SinkReply result, boolean activeRequest, boolean allowDefault) {
SinkReply reply = null;
LogisticsModule module = destination.getLogisticsModule();
CoreRoutedPipe crp = destination.getPipe();
if (module == null) {
return null;
}
if (!(module.recievePassive() || activeRequest)) {
return null;
}
if (crp == null || !crp.isEnabled()) {
return null;
}
if (excludeSource && sourceRouter != null) {
if (destination.getPipe().sharesInterestWith(sourceRouter.getPipe())) {
return null;
}
}
if (result == null) {
reply = module.sinksItem(stack, -1, 0, allowDefault, true);
} else {
reply = module.sinksItem(stack, result.fixedPriority.ordinal(), result.customPriority, allowDefault, true);
}
if (result != null && result.maxNumberOfItems < 0) {
return null;
}
return reply;
}
Aggregations