public static StructureBoundingBox a(List list, Random random, int i, int j, int k, int l) {
    StructureBoundingBox structureboundingbox = new StructureBoundingBox(i, j, k, i, j + 2, k);

    if (random.nextInt(4) == 0) {
      structureboundingbox.e += 4;
    }

    switch (l) {
      case 0:
        structureboundingbox.a = i - 1;
        structureboundingbox.d = i + 3;
        structureboundingbox.f = k + 4;
        break;

      case 1:
        structureboundingbox.a = i - 4;
        structureboundingbox.c = k - 1;
        structureboundingbox.f = k + 3;
        break;

      case 2:
        structureboundingbox.a = i - 1;
        structureboundingbox.d = i + 3;
        structureboundingbox.c = k - 4;
        break;

      case 3:
        structureboundingbox.d = i + 4;
        structureboundingbox.c = k - 1;
        structureboundingbox.f = k + 3;
    }

    return StructurePiece.a(list, structureboundingbox) != null ? null : structureboundingbox;
  }
 public static WorldGenNetherPiece1 a(
     List var0, Random var1, int var2, int var3, int var4, BlockFace var5, int var6) {
   CuboidArea var7 = CuboidArea.a(var2, var3, var4, -8, -3, 0, 19, 10, 19, var5);
   return a(var7) && StructurePiece.a(var0, var7) == null
       ? new WorldGenNetherPiece1(var6, var1, var7, var5)
       : null;
 }
  private static StructurePiece b(
      StructurePiece structurepiece, List list, Random random, int i, int j, int k, int l, int i1) {
    if (i1 > 8) {
      return null;
    } else if (Math.abs(i - structurepiece.b().a) <= 80
        && Math.abs(k - structurepiece.b().c) <= 80) {
      StructurePiece structurepiece1 = a(list, random, i, j, k, l, i1 + 1);

      if (structurepiece1 != null) {
        list.add(structurepiece1);
        structurepiece1.a(structurepiece, list, random);
      }

      return structurepiece1;
    } else {
      return null;
    }
  }
  public static WorldGenNetherPiece11 a(
      List list, Random random, int i, int j, int k, int l, int i1) {
    StructureBoundingBox structureboundingbox =
        StructureBoundingBox.a(i, j, k, -2, 0, 0, 7, 9, 7, l);

    return a(structureboundingbox) && StructurePiece.a(list, structureboundingbox) == null
        ? new WorldGenNetherPiece11(i1, random, structureboundingbox, l)
        : null;
  }
  public static WorldGenStrongholdRoomCrossing a(
      List list, Random random, int i, int j, int k, int l, int i1) {
    StructureBoundingBox structureboundingbox =
        StructureBoundingBox.a(i, j, k, -4, -1, 0, 11, 7, 11, l);

    return a(structureboundingbox) && StructurePiece.a(list, structureboundingbox) == null
        ? new WorldGenStrongholdRoomCrossing(i1, random, structureboundingbox, l)
        : null;
  }
  public static WorldGenNetherPiece5 a(
      List list, Random random, int i, int j, int k, EnumDirection enumdirection, int l) {
    StructureBoundingBox structureboundingbox =
        StructureBoundingBox.a(i, j, k, -3, 0, 0, 9, 7, 9, enumdirection);

    return a(structureboundingbox) && StructurePiece.a(list, structureboundingbox) == null
        ? new WorldGenNetherPiece5(l, random, structureboundingbox, enumdirection)
        : null;
  }
  public static WorldGenStrongholdStairs2 a(
      List list, Random random, int i, int j, int k, int l, int i1) {
    StructureBoundingBox structureboundingbox =
        StructureBoundingBox.a(i, j, k, -1, -7, 0, 5, 11, 5, l);

    return a(structureboundingbox) && StructurePiece.a(list, structureboundingbox) == null
        ? new WorldGenStrongholdStairs2(i1, random, structureboundingbox, l)
        : null;
  }
  public static WorldGenVillageButcher a(
      List paramList,
      Random paramRandom,
      int paramInt1,
      int paramInt2,
      int paramInt3,
      int paramInt4,
      int paramInt5) {
    StructureBoundingBox localStructureBoundingBox =
        StructureBoundingBox.a(paramInt1, paramInt2, paramInt3, 0, 0, 0, 9, 7, 11, paramInt4);

    if ((!a(localStructureBoundingBox))
        || (StructurePiece.a(paramList, localStructureBoundingBox) != null)) {
      return null;
    }

    return new WorldGenVillageButcher(paramInt5, paramRandom, localStructureBoundingBox, paramInt4);
  }
  public static StructureBoundingBox a(
      WorldGenVillageStartPiece worldgenvillagestartpiece,
      List list,
      Random random,
      int i,
      int j,
      int k,
      int l) {
    for (int i1 = 7 * MathHelper.nextInt(random, 3, 5); i1 >= 7; i1 -= 7) {
      StructureBoundingBox structureboundingbox =
          StructureBoundingBox.a(i, j, k, 0, 0, 0, 3, 3, i1, l);

      if (StructurePiece.a(list, structureboundingbox) == null) {
        return structureboundingbox;
      }
    }

    return null;
  }
  public static StructureBoundingBox a(
      List paramList,
      Random paramRandom,
      int paramInt1,
      int paramInt2,
      int paramInt3,
      int paramInt4) {
    StructureBoundingBox localStructureBoundingBox =
        new StructureBoundingBox(
            paramInt1, paramInt2, paramInt3, paramInt1, paramInt2 + 2, paramInt3);

    int i = paramRandom.nextInt(3) + 2;
    while (i > 0) {
      int j = i * 5;

      switch (paramInt4) {
        case 2:
          localStructureBoundingBox.d = (paramInt1 + 2);
          localStructureBoundingBox.c = (paramInt3 - (j - 1));
          break;
        case 0:
          localStructureBoundingBox.d = (paramInt1 + 2);
          localStructureBoundingBox.f = (paramInt3 + (j - 1));
          break;
        case 1:
          localStructureBoundingBox.a = (paramInt1 - (j - 1));
          localStructureBoundingBox.f = (paramInt3 + 2);
          break;
        case 3:
          localStructureBoundingBox.d = (paramInt1 + (j - 1));
          localStructureBoundingBox.f = (paramInt3 + 2);
      }

      if (StructurePiece.a(paramList, localStructureBoundingBox) == null) break;
      i--;
    }

    if (i > 0) {
      return localStructureBoundingBox;
    }

    return null;
  }
  public static WorldGenVillageFarm a(
      WorldGenVillageStartPiece paramWorldGenVillageStartPiece,
      List paramList,
      Random paramRandom,
      int paramInt1,
      int paramInt2,
      int paramInt3,
      int paramInt4,
      int paramInt5) {
    StructureBoundingBox localStructureBoundingBox =
        StructureBoundingBox.a(paramInt1, paramInt2, paramInt3, 0, 0, 0, 7, 4, 9, paramInt4);

    if ((!a(localStructureBoundingBox))
        || (StructurePiece.a(paramList, localStructureBoundingBox) != null)) {
      return null;
    }

    return new WorldGenVillageFarm(
        paramWorldGenVillageStartPiece,
        paramInt5,
        paramRandom,
        localStructureBoundingBox,
        paramInt4);
  }
  public void a(StructurePiece structurepiece, List list, Random random) {
    int i = this.d();
    int j = this.f.c() - 3 - 1;

    if (j <= 0) {
      j = 1;
    }

    int k;
    StructurePiece structurepiece1;
    StructureBoundingBox structureboundingbox;

    for (k = 0; k < this.f.b(); k += 4) {
      k += random.nextInt(this.f.b());
      if (k + 3 > this.f.b()) {
        break;
      }

      structurepiece1 =
          WorldGenMineshaftPieces.a(
              structurepiece,
              list,
              random,
              this.f.a + k,
              this.f.b + random.nextInt(j) + 1,
              this.f.c - 1,
              2,
              i);
      if (structurepiece1 != null) {
        structureboundingbox = structurepiece1.c();
        this.a.add(
            new StructureBoundingBox(
                structureboundingbox.a,
                structureboundingbox.b,
                this.f.c,
                structureboundingbox.d,
                structureboundingbox.e,
                this.f.c + 1));
      }
    }

    for (k = 0; k < this.f.b(); k += 4) {
      k += random.nextInt(this.f.b());
      if (k + 3 > this.f.b()) {
        break;
      }

      structurepiece1 =
          WorldGenMineshaftPieces.a(
              structurepiece,
              list,
              random,
              this.f.a + k,
              this.f.b + random.nextInt(j) + 1,
              this.f.f + 1,
              0,
              i);
      if (structurepiece1 != null) {
        structureboundingbox = structurepiece1.c();
        this.a.add(
            new StructureBoundingBox(
                structureboundingbox.a,
                structureboundingbox.b,
                this.f.f - 1,
                structureboundingbox.d,
                structureboundingbox.e,
                this.f.f));
      }
    }

    for (k = 0; k < this.f.d(); k += 4) {
      k += random.nextInt(this.f.d());
      if (k + 3 > this.f.d()) {
        break;
      }

      structurepiece1 =
          WorldGenMineshaftPieces.a(
              structurepiece,
              list,
              random,
              this.f.a - 1,
              this.f.b + random.nextInt(j) + 1,
              this.f.c + k,
              1,
              i);
      if (structurepiece1 != null) {
        structureboundingbox = structurepiece1.c();
        this.a.add(
            new StructureBoundingBox(
                this.f.a,
                structureboundingbox.b,
                structureboundingbox.c,
                this.f.a + 1,
                structureboundingbox.e,
                structureboundingbox.f));
      }
    }

    for (k = 0; k < this.f.d(); k += 4) {
      k += random.nextInt(this.f.d());
      if (k + 3 > this.f.d()) {
        break;
      }

      structurepiece1 =
          WorldGenMineshaftPieces.a(
              structurepiece,
              list,
              random,
              this.f.d + 1,
              this.f.b + random.nextInt(j) + 1,
              this.f.c + k,
              3,
              i);
      if (structurepiece1 != null) {
        structureboundingbox = structurepiece1.c();
        this.a.add(
            new StructureBoundingBox(
                this.f.d - 1,
                structureboundingbox.b,
                structureboundingbox.c,
                this.f.d,
                structureboundingbox.e,
                structureboundingbox.f));
      }
    }
  }