Program: 156296
Project: 156296
Buggy source:
private void buildQueue(){
  world.profiler.startSection("String_Node_Str");
  queue.clear();
  paths.clear();
  queueFluid=null;
  Set<BlockPos> checked=new HashSet<>();
  List<BlockPos> nextPosesToCheck=new ArrayList<>();
  for (BlockPos posToCheck=pos.down(); posToCheck.getY() > 0; posToCheck=posToCheck.down()) {
    if (BlockUtil.getFluidWithFlowing(world,posToCheck) != null) {
      queueFluid=BlockUtil.getFluidWithFlowing(world,posToCheck);
      nextPosesToCheck.add(posToCheck);
      paths.put(posToCheck,Collections.singletonList(posToCheck));
      checked.add(posToCheck);
      if (BlockUtil.getFluid(world,posToCheck) != null) {
        queue.add(posToCheck);
      }
      fluidConnection=posToCheck;
      break;
    }
 else     if (!world.isAirBlock(posToCheck) && world.getBlockState(posToCheck).getBlock() != BCFactoryBlocks.tube) {
      break;
    }
  }
  if (nextPosesToCheck.isEmpty()) {
    world.profiler.endSection();
    return;
  }
  world.profiler.endStartSection("String_Node_Str");
  while (!nextPosesToCheck.isEmpty()) {
    List<BlockPos> nextPosesToCheckCopy=new ArrayList<>(nextPosesToCheck);
    nextPosesToCheck.clear();
    for (    BlockPos posToCheck : nextPosesToCheckCopy) {
      for (      EnumFacing side : new EnumFacing[]{EnumFacing.UP,EnumFacing.NORTH,EnumFacing.SOUTH,EnumFacing.WEST,EnumFacing.EAST}) {
        BlockPos offsetPos=posToCheck.offset(side);
        if ((offsetPos.getX() - pos.getX()) * (offsetPos.getX() - pos.getX()) + (offsetPos.getZ() - pos.getZ()) * (offsetPos.getZ() - pos.getZ()) > 64 * 64) {
          continue;
        }
        if (checked.add(offsetPos)) {
          if (FluidUtilBC.areFluidsEqual(BlockUtil.getFluidWithFlowing(world,offsetPos),queueFluid)) {
            ImmutableList.Builder<BlockPos> pathBuilder=new ImmutableList.Builder<>();
            pathBuilder.addAll(paths.get(posToCheck));
            pathBuilder.add(offsetPos);
            paths.put(offsetPos,pathBuilder.build());
            if (BlockUtil.getFluid(world,offsetPos) != null) {
              queue.add(offsetPos);
            }
            nextPosesToCheck.add(offsetPos);
          }
        }
      }
    }
  }
  world.profiler.endStartSection("String_Node_Str");
  if (FluidUtilBC.areFluidsEqual(queueFluid,BCEnergyFluids.crudeOil[0])) {
    List<BlockPos> springPositions=new ArrayList<>();
    BlockPos center=VecUtil.replaceValue(getPos(),Axis.Y,0);
    for (    BlockPos spring : BlockPos.getAllInBox(center.add(-10,0,-10),center.add(10,0,10))) {
      if (world.getBlockState(spring).getBlock() == BCCoreBlocks.spring) {
        BCLog.logger.info("String_Node_Str" + spring);
        TileEntity tile=world.getTileEntity(spring);
        if (tile instanceof TileSpringOil) {
          springPositions.add(spring);
          BCLog.logger.info("String_Node_Str" + spring);
        }
      }
    }
switch (springPositions.size()) {
case 0:
      break;
case 1:
    oilSpringPos=springPositions.get(0);
  break;
default :
springPositions.sort(Comparator.comparingDouble(pos::distanceSq));
oilSpringPos=springPositions.get(0);
}
}
world.profiler.endSection();
}

Fixed version (ground truth):
private void buildQueue(){
  world.profiler.startSection("String_Node_Str");
  queue.clear();
  paths.clear();
  queueFluid=null;
  Set<BlockPos> checked=new HashSet<>();
  List<BlockPos> nextPosesToCheck=new ArrayList<>();
  for (BlockPos posToCheck=pos.down(); posToCheck.getY() > 0; posToCheck=posToCheck.down()) {
    if (BlockUtil.getFluidWithFlowing(world,posToCheck) != null) {
      queueFluid=BlockUtil.getFluidWithFlowing(world,posToCheck);
      nextPosesToCheck.add(posToCheck);
      paths.put(posToCheck,Collections.singletonList(posToCheck));
      checked.add(posToCheck);
      if (BlockUtil.getFluid(world,posToCheck) != null) {
        queue.add(posToCheck);
      }
      fluidConnection=posToCheck;
      break;
    }
 else     if (!world.isAirBlock(posToCheck) && world.getBlockState(posToCheck).getBlock() != BCFactoryBlocks.tube) {
      break;
    }
  }
  if (nextPosesToCheck.isEmpty()) {
    world.profiler.endSection();
    return;
  }
  world.profiler.endStartSection("String_Node_Str");
  while (!nextPosesToCheck.isEmpty()) {
    List<BlockPos> nextPosesToCheckCopy=new ArrayList<>(nextPosesToCheck);
    nextPosesToCheck.clear();
    for (    BlockPos posToCheck : nextPosesToCheckCopy) {
      for (      EnumFacing side : new EnumFacing[]{EnumFacing.UP,EnumFacing.NORTH,EnumFacing.SOUTH,EnumFacing.WEST,EnumFacing.EAST}) {
        BlockPos offsetPos=posToCheck.offset(side);
        if ((offsetPos.getX() - pos.getX()) * (offsetPos.getX() - pos.getX()) + (offsetPos.getZ() - pos.getZ()) * (offsetPos.getZ() - pos.getZ()) > 64 * 64) {
          continue;
        }
        if (checked.add(offsetPos)) {
          if (FluidUtilBC.areFluidsEqual(BlockUtil.getFluidWithFlowing(world,offsetPos),queueFluid)) {
            ImmutableList.Builder<BlockPos> pathBuilder=new ImmutableList.Builder<>();
            pathBuilder.addAll(paths.get(posToCheck));
            pathBuilder.add(offsetPos);
            paths.put(offsetPos,pathBuilder.build());
            if (BlockUtil.getFluid(world,offsetPos) != null) {
              queue.add(offsetPos);
            }
            nextPosesToCheck.add(offsetPos);
          }
        }
      }
    }
  }
  world.profiler.endStartSection("String_Node_Str");
  if (FluidUtilBC.areFluidsEqual(queueFluid,BCEnergyFluids.crudeOil[0])) {
    List<BlockPos> springPositions=new ArrayList<>();
    BlockPos center=VecUtil.replaceValue(getPos(),Axis.Y,0);
    for (    BlockPos spring : BlockPos.getAllInBox(center.add(-10,0,-10),center.add(10,0,10))) {
      if (world.getBlockState(spring).getBlock() == BCCoreBlocks.spring) {
        TileEntity tile=world.getTileEntity(spring);
        if (tile instanceof TileSpringOil) {
          springPositions.add(spring);
        }
      }
    }
switch (springPositions.size()) {
case 0:
      break;
case 1:
    oilSpringPos=springPositions.get(0);
  break;
default :
springPositions.sort(Comparator.comparingDouble(pos::distanceSq));
oilSpringPos=springPositions.get(0);
}
}
world.profiler.endSection();
}