use of logisticspipes.pipes.basic.CoreRoutedPipe in project LogisticsPipes by RS485.
the class ServerRouter method getPipe.
@Override
public CoreRoutedPipe getPipe() {
CoreRoutedPipe crp = getCachedPipe();
if (crp != null) {
return crp;
}
World worldObj = DimensionManager.getWorld(_dimension);
if (worldObj == null) {
return null;
}
TileEntity tile = worldObj.getTileEntity(_xCoord, _yCoord, _zCoord);
if (!(tile instanceof LogisticsTileGenericPipe)) {
return null;
}
LogisticsTileGenericPipe pipe = (LogisticsTileGenericPipe) tile;
if (!(pipe.pipe instanceof CoreRoutedPipe)) {
return null;
}
_myPipeCache = new WeakReference<>((CoreRoutedPipe) pipe.pipe);
return (CoreRoutedPipe) pipe.pipe;
}
use of logisticspipes.pipes.basic.CoreRoutedPipe in project LogisticsPipes by RS485.
the class ServerRouter method checkAdjacentUpdate.
@Override
public boolean checkAdjacentUpdate() {
boolean blockNeedsUpdate = recheckAdjacent();
if (!blockNeedsUpdate) {
return false;
}
CoreRoutedPipe pipe = getPipe();
if (pipe == null) {
return true;
}
pipe.refreshRender(true);
return true;
}
use of logisticspipes.pipes.basic.CoreRoutedPipe 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