for(Entry<Integer, Float> order:orders.entrySet()) {
float toSend = order.getValue() * fullfullratio;
if(toSend > internalStorage) {
toSend = internalStorage;
}
IRouter destinationRouter = SimpleServiceLocator.routerManager.getRouter(order.getKey());
if(destinationRouter != null && destinationRouter.getPipe() != null) {
WorldUtil util = new WorldUtil(getWorldObj(), xCoord, yCoord, zCoord);
outerTiles:
for(AdjacentTile adjacent: util.getAdjacentTileEntities(false)) {
if(adjacent.tile instanceof LogisticsTileGenericPipe) {
if(((LogisticsTileGenericPipe)adjacent.tile).pipe instanceof CoreRoutedPipe) {
if(((CoreRoutedPipe)((LogisticsTileGenericPipe)adjacent.tile).pipe).stillNeedReplace()) continue;
IRouter sourceRouter = ((CoreRoutedPipe)((LogisticsTileGenericPipe)adjacent.tile).pipe).getRouter();
if(sourceRouter != null) {
outerRouters:
for(ExitRoute exit:sourceRouter.getDistanceTo(destinationRouter)) {
if(exit.containsFlag(PipeRoutingConnectionType.canPowerSubSystemFrom)) {
for(IFilter filter:exit.filters) {
if(filter.blockPower()) continue outerRouters;
}
//MainProxy.sendPacketToAllWatchingChunk(xCoord, zCoord, sourceRouter.getDimension(), PacketHandler.getPacket(PowerPacketLaser.class).setColor(this.getLaserColor()).setPos(sourceRouter.getLPPosition()).setDir(adjacent.orientation.getOpposite()).setReverse(true).setLength(1));
CoreRoutedPipe pipe = sourceRouter.getPipe();
if(pipe != null && pipe.container instanceof LogisticsTileGenericPipe) {
((LogisticsTileGenericPipe)pipe.container).addLaser(adjacent.orientation.getOpposite(), 1, this.getLaserColor(), true, true);
}
try {
currentlyUsedPos.add(sourceRouter.getLPPosition());
sendPowerLaserPackets(sourceRouter, destinationRouter, exit.exitOrientation, exit.exitOrientation != adjacent.orientation);
currentlyUsedPos.remove(sourceRouter.getLPPosition());
} catch(StackOverflowError error) {
for(LPPosition pos:currentlyUsedPos) {
System.out.println(pos);
}
throw error;