public BlockPos func_180706_b(World world, BlockPos pos) {
    this.world = world;
    this.func_143027_a(world);
    this.rand.setSeed(world.getSeed());
    long var3 = this.rand.nextLong();
    long var5 = this.rand.nextLong();
    long var7 = (long) (pos.x >> 4) * var3;
    long var9 = (long) (pos.z >> 4) * var5;
    this.rand.setSeed(var7 ^ var9 ^ world.getSeed());
    this.func_180701_a(world, pos.x >> 4, pos.z >> 4, 0, 0, null);
    double var11 = Double.MAX_VALUE;
    BlockPos var13 = null;
    BlockPos var17;
    double var18;

    for (StructureStart var15 : this.structureMap.values()) {
      if (var15.isSizeableStructure()) {
        StructureComponent var16 = var15.getComponents().get(0);
        var17 = var16.getCenter();
        var18 = var17.squareDistanceTo(pos);

        if (var18 < var11) {
          var11 = var18;
          var13 = var17;
        }
      }
    }

    if (var13 != null) {
      return var13;
    } else {
      List<BlockPos> var20 = this.getCoordList();

      if (var20 != null) {
        BlockPos var21 = null;

        for (BlockPos p : var20) {
          var18 = p.squareDistanceTo(pos);

          if (var18 < var11) {
            var11 = var18;
            var21 = p;
          }
        }

        return var21;
      } else {
        return null;
      }
    }
  }