public void a(StructurePiece structurepiece, List list, Random random) {
   WorldGenVillagePieces.b(
       (WorldGenVillageStartPiece) structurepiece,
       list,
       random,
       this.l.a - 1,
       this.l.e - 4,
       this.l.c + 1,
       EnumDirection.WEST,
       this.d());
   WorldGenVillagePieces.b(
       (WorldGenVillageStartPiece) structurepiece,
       list,
       random,
       this.l.d + 1,
       this.l.e - 4,
       this.l.c + 1,
       EnumDirection.EAST,
       this.d());
   WorldGenVillagePieces.b(
       (WorldGenVillageStartPiece) structurepiece,
       list,
       random,
       this.l.a + 1,
       this.l.e - 4,
       this.l.c - 1,
       EnumDirection.NORTH,
       this.d());
   WorldGenVillagePieces.b(
       (WorldGenVillageStartPiece) structurepiece,
       list,
       random,
       this.l.a + 1,
       this.l.e - 4,
       this.l.f + 1,
       EnumDirection.SOUTH,
       this.d());
 }
  public void a(StructurePiece structurepiece, List list, Random random) {
    boolean flag = false;

    int i;
    StructurePiece structurepiece1;

    for (i = random.nextInt(5); i < this.a - 8; i += 2 + random.nextInt(5)) {
      structurepiece1 = this.a((WorldGenVillageStartPiece) structurepiece, list, random, 0, i);
      if (structurepiece1 != null) {
        i += Math.max(structurepiece1.f.b(), structurepiece1.f.d());
        flag = true;
      }
    }

    for (i = random.nextInt(5); i < this.a - 8; i += 2 + random.nextInt(5)) {
      structurepiece1 = this.b((WorldGenVillageStartPiece) structurepiece, list, random, 0, i);
      if (structurepiece1 != null) {
        i += Math.max(structurepiece1.f.b(), structurepiece1.f.d());
        flag = true;
      }
    }

    if (flag && random.nextInt(3) > 0) {
      switch (this.g) {
        case 0:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.a - 1,
              this.f.b,
              this.f.f - 2,
              1,
              this.d());
          break;

        case 1:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.a,
              this.f.b,
              this.f.c - 1,
              2,
              this.d());
          break;

        case 2:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.a - 1,
              this.f.b,
              this.f.c,
              1,
              this.d());
          break;

        case 3:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.d - 2,
              this.f.b,
              this.f.c - 1,
              2,
              this.d());
      }
    }

    if (flag && random.nextInt(3) > 0) {
      switch (this.g) {
        case 0:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.d + 1,
              this.f.b,
              this.f.f - 2,
              3,
              this.d());
          break;

        case 1:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.a,
              this.f.b,
              this.f.f + 1,
              0,
              this.d());
          break;

        case 2:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.d + 1,
              this.f.b,
              this.f.c,
              3,
              this.d());
          break;

        case 3:
          WorldGenVillagePieces.b(
              (WorldGenVillageStartPiece) structurepiece,
              list,
              random,
              this.f.d - 2,
              this.f.b,
              this.f.f + 1,
              0,
              this.d());
      }
    }
  }