use of logisticspipes.routing.IRouterManager in project LogisticsPipes by RS485.
the class HudUpdateTick method tick.
public static void tick() {
if (HudUpdateTick.firstRouter == -1) {
return;
}
IRouterManager rm = SimpleServiceLocator.routerManager;
int slotSentCount = 0;
//cork the compressor
SimpleServiceLocator.serverBufferHandler.setPause(true);
while (HudUpdateTick.firstRouter != -1 && slotSentCount < HudUpdateTick.inventorySlotsToUpdatePerTick) {
HudUpdateTick.routersNeedingUpdate.clear(HudUpdateTick.firstRouter);
IRouter currentRouter = rm.getRouterUnsafe(HudUpdateTick.firstRouter, false);
if (currentRouter != null) {
CoreRoutedPipe pipe = currentRouter.getCachedPipe();
if (pipe != null) {
slotSentCount += pipe.sendQueueChanged(true);
}
}
HudUpdateTick.firstRouter = HudUpdateTick.routersNeedingUpdate.nextSetBit(HudUpdateTick.firstRouter);
}
//and let it compress and send
SimpleServiceLocator.serverBufferHandler.setPause(false);
}
Aggregations