public WorldGenVillageRoad(
     WorldGenVillageStartPiece worldgenvillagestartpiece,
     int i,
     Random random,
     StructureBoundingBox structureboundingbox,
     int j) {
   super(worldgenvillagestartpiece, i);
   this.g = j;
   this.f = structureboundingbox;
   this.a = Math.max(structureboundingbox.b(), structureboundingbox.d());
 }
  public WorldGenMineshaftCorridor(
      int paramInt1,
      Random paramRandom,
      StructureBoundingBox paramStructureBoundingBox,
      int paramInt2) {
    super(paramInt1);
    this.h = paramInt2;
    this.g = paramStructureBoundingBox;
    this.a = (paramRandom.nextInt(3) == 0);
    this.b = ((!this.a) && (paramRandom.nextInt(23) == 0));

    if ((this.h == 2) || (this.h == 0)) this.d = (paramStructureBoundingBox.d() / 5);
    else this.d = (paramStructureBoundingBox.b() / 5);
  }
  public boolean a(World world, Random random, StructureBoundingBox structureboundingbox) {
    Block block = this.b(Blocks.GRAVEL, 0);

    for (int i = this.f.a; i <= this.f.d; ++i) {
      for (int j = this.f.c; j <= this.f.f; ++j) {
        if (structureboundingbox.b(i, 64, j)) {
          int k = world.i(i, j) - 1;

          world.setTypeAndData(i, k, j, block, 0, 2);
        }
      }
    }

    return true;
  }
  protected boolean a(World world, StructureBoundingBox structureboundingbox, int i, int j, int k) {
    int l = this.a(i, k);
    int i1 = this.d(j);
    int j1 = this.b(i, k);

    if (structureboundingbox.b((BaseBlockPosition) (new BlockPosition(l, i1, j1)))) {
      EntityGuardian entityguardian = new EntityGuardian(world);

      entityguardian.a(true);
      entityguardian.heal(entityguardian.getMaxHealth());
      entityguardian.setPositionRotation(
          (double) l + 0.5D, (double) i1, (double) j1 + 0.5D, 0.0F, 0.0F);
      entityguardian.prepare(world.E(new BlockPosition(entityguardian)), (GroupDataEntity) null);
      world.addEntity(entityguardian);
      return true;
    } else {
      return false;
    }
  }
  public boolean a(
      World paramWorld, Random paramRandom, StructureBoundingBox paramStructureBoundingBox) {
    if (this.b < 0) {
      this.b = b(paramWorld, paramStructureBoundingBox);
      if (this.b < 0) {
        return true;
      }
      this.e.a(0, this.b - this.e.e + 6 - 1, 0);
    }

    a(paramWorld, paramStructureBoundingBox, 0, 1, 0, 9, 4, 6, 0, 0, false);

    a(
        paramWorld,
        paramStructureBoundingBox,
        0,
        0,
        0,
        9,
        0,
        6,
        Block.COBBLESTONE.id,
        Block.COBBLESTONE.id,
        false);

    a(
        paramWorld,
        paramStructureBoundingBox,
        0,
        4,
        0,
        9,
        4,
        6,
        Block.COBBLESTONE.id,
        Block.COBBLESTONE.id,
        false);
    a(paramWorld, paramStructureBoundingBox, 0, 5, 0, 9, 5, 6, Block.STEP.id, Block.STEP.id, false);
    a(paramWorld, paramStructureBoundingBox, 1, 5, 1, 8, 5, 5, 0, 0, false);

    a(paramWorld, paramStructureBoundingBox, 1, 1, 0, 2, 3, 0, Block.WOOD.id, Block.WOOD.id, false);
    a(paramWorld, paramStructureBoundingBox, 0, 1, 0, 0, 4, 0, Block.LOG.id, Block.LOG.id, false);
    a(paramWorld, paramStructureBoundingBox, 3, 1, 0, 3, 4, 0, Block.LOG.id, Block.LOG.id, false);
    a(paramWorld, paramStructureBoundingBox, 0, 1, 6, 0, 4, 6, Block.LOG.id, Block.LOG.id, false);
    a(paramWorld, Block.WOOD.id, 0, 3, 3, 1, paramStructureBoundingBox);
    a(paramWorld, paramStructureBoundingBox, 3, 1, 2, 3, 3, 2, Block.WOOD.id, Block.WOOD.id, false);
    a(paramWorld, paramStructureBoundingBox, 4, 1, 3, 5, 3, 3, Block.WOOD.id, Block.WOOD.id, false);
    a(paramWorld, paramStructureBoundingBox, 0, 1, 1, 0, 3, 5, Block.WOOD.id, Block.WOOD.id, false);
    a(paramWorld, paramStructureBoundingBox, 1, 1, 6, 5, 3, 6, Block.WOOD.id, Block.WOOD.id, false);

    a(
        paramWorld,
        paramStructureBoundingBox,
        5,
        1,
        0,
        5,
        3,
        0,
        Block.FENCE.id,
        Block.FENCE.id,
        false);
    a(
        paramWorld,
        paramStructureBoundingBox,
        9,
        1,
        0,
        9,
        3,
        0,
        Block.FENCE.id,
        Block.FENCE.id,
        false);

    a(
        paramWorld,
        paramStructureBoundingBox,
        6,
        1,
        4,
        9,
        4,
        6,
        Block.COBBLESTONE.id,
        Block.COBBLESTONE.id,
        false);
    a(paramWorld, Block.LAVA.id, 0, 7, 1, 5, paramStructureBoundingBox);
    a(paramWorld, Block.LAVA.id, 0, 8, 1, 5, paramStructureBoundingBox);
    a(paramWorld, Block.IRON_FENCE.id, 0, 9, 2, 5, paramStructureBoundingBox);
    a(paramWorld, Block.IRON_FENCE.id, 0, 9, 2, 4, paramStructureBoundingBox);
    a(paramWorld, paramStructureBoundingBox, 7, 2, 4, 8, 2, 5, 0, 0, false);
    a(paramWorld, Block.COBBLESTONE.id, 0, 6, 1, 3, paramStructureBoundingBox);
    a(paramWorld, Block.FURNACE.id, 0, 6, 2, 3, paramStructureBoundingBox);
    a(paramWorld, Block.FURNACE.id, 0, 6, 3, 3, paramStructureBoundingBox);
    a(paramWorld, Block.DOUBLE_STEP.id, 0, 8, 1, 1, paramStructureBoundingBox);

    a(paramWorld, Block.THIN_GLASS.id, 0, 0, 2, 2, paramStructureBoundingBox);
    a(paramWorld, Block.THIN_GLASS.id, 0, 0, 2, 4, paramStructureBoundingBox);
    a(paramWorld, Block.THIN_GLASS.id, 0, 2, 2, 6, paramStructureBoundingBox);
    a(paramWorld, Block.THIN_GLASS.id, 0, 4, 2, 6, paramStructureBoundingBox);

    a(paramWorld, Block.FENCE.id, 0, 2, 1, 4, paramStructureBoundingBox);
    a(paramWorld, Block.WOOD_PLATE.id, 0, 2, 2, 4, paramStructureBoundingBox);
    a(paramWorld, Block.WOOD.id, 0, 1, 1, 5, paramStructureBoundingBox);
    a(
        paramWorld,
        Block.WOOD_STAIRS.id,
        c(Block.WOOD_STAIRS.id, 3),
        2,
        1,
        5,
        paramStructureBoundingBox);
    a(
        paramWorld,
        Block.WOOD_STAIRS.id,
        c(Block.WOOD_STAIRS.id, 1),
        1,
        1,
        4,
        paramStructureBoundingBox);
    int j;
    if (!this.c) {
      i = a(1);
      j = a(5, 5);
      int k = b(5, 5);
      if (paramStructureBoundingBox.b(j, i, k)) {
        this.c = true;
        a(
            paramWorld,
            paramStructureBoundingBox,
            paramRandom,
            5,
            1,
            5,
            a,
            3 + paramRandom.nextInt(6));
      }
    }

    for (int i = 6; i <= 8; i++) {
      if ((a(paramWorld, i, 0, -1, paramStructureBoundingBox) == 0)
          && (a(paramWorld, i, -1, -1, paramStructureBoundingBox) != 0)) {
        a(
            paramWorld,
            Block.COBBLESTONE_STAIRS.id,
            c(Block.COBBLESTONE_STAIRS.id, 3),
            i,
            0,
            -1,
            paramStructureBoundingBox);
      }
    }

    for (i = 0; i < 7; i++) {
      for (j = 0; j < 10; j++) {
        b(paramWorld, j, 6, i, paramStructureBoundingBox);
        b(paramWorld, Block.COBBLESTONE.id, 0, j, -1, i, paramStructureBoundingBox);
      }
    }

    a(paramWorld, paramStructureBoundingBox, 7, 1, 1, 1);

    return true;
  }
  public boolean a(World world, Random random, StructureBoundingBox structureboundingbox) {
    this.a(
        world,
        structureboundingbox,
        0,
        0,
        0,
        4,
        1,
        4,
        Block.NETHER_BRICK.id,
        Block.NETHER_BRICK.id,
        false);
    this.a(world, structureboundingbox, 0, 2, 0, 4, 5, 4, 0, 0, false);
    this.a(
        world,
        structureboundingbox,
        4,
        2,
        0,
        4,
        5,
        4,
        Block.NETHER_BRICK.id,
        Block.NETHER_BRICK.id,
        false);
    this.a(
        world,
        structureboundingbox,
        4,
        3,
        1,
        4,
        4,
        1,
        Block.NETHER_FENCE.id,
        Block.NETHER_FENCE.id,
        false);
    this.a(
        world,
        structureboundingbox,
        4,
        3,
        3,
        4,
        4,
        3,
        Block.NETHER_FENCE.id,
        Block.NETHER_FENCE.id,
        false);
    this.a(
        world,
        structureboundingbox,
        0,
        2,
        0,
        0,
        5,
        0,
        Block.NETHER_BRICK.id,
        Block.NETHER_BRICK.id,
        false);
    this.a(
        world,
        structureboundingbox,
        0,
        2,
        4,
        3,
        5,
        4,
        Block.NETHER_BRICK.id,
        Block.NETHER_BRICK.id,
        false);
    this.a(
        world,
        structureboundingbox,
        1,
        3,
        4,
        1,
        4,
        4,
        Block.NETHER_FENCE.id,
        Block.NETHER_BRICK.id,
        false);
    this.a(
        world,
        structureboundingbox,
        3,
        3,
        4,
        3,
        4,
        4,
        Block.NETHER_FENCE.id,
        Block.NETHER_BRICK.id,
        false);
    int i;
    int j;

    if (this.b) {
      i = this.a(2);
      j = this.a(3, 3);
      int k = this.b(3, 3);

      if (structureboundingbox.b(j, i, k)) {
        this.b = false;
        this.a(world, structureboundingbox, random, 3, 2, 3, a, 2 + random.nextInt(4));
      }
    }

    this.a(
        world,
        structureboundingbox,
        0,
        6,
        0,
        4,
        6,
        4,
        Block.NETHER_BRICK.id,
        Block.NETHER_BRICK.id,
        false);

    for (i = 0; i <= 4; ++i) {
      for (j = 0; j <= 4; ++j) {
        this.b(world, Block.NETHER_BRICK.id, 0, i, -1, j, structureboundingbox);
      }
    }

    return true;
  }
  public boolean a(World world, Random random, StructureBoundingBox structureboundingbox) {
    this.a(
        world,
        structureboundingbox,
        0,
        0,
        0,
        4,
        1,
        4,
        Blocks.NETHER_BRICK.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        0,
        2,
        0,
        4,
        5,
        4,
        Blocks.AIR.getBlockData(),
        Blocks.AIR.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        0,
        2,
        0,
        0,
        5,
        4,
        Blocks.NETHER_BRICK.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        0,
        3,
        1,
        0,
        4,
        1,
        Blocks.NETHER_BRICK_FENCE.getBlockData(),
        Blocks.NETHER_BRICK_FENCE.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        0,
        3,
        3,
        0,
        4,
        3,
        Blocks.NETHER_BRICK_FENCE.getBlockData(),
        Blocks.NETHER_BRICK_FENCE.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        4,
        2,
        0,
        4,
        5,
        0,
        Blocks.NETHER_BRICK.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        1,
        2,
        4,
        4,
        5,
        4,
        Blocks.NETHER_BRICK.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        1,
        3,
        4,
        1,
        4,
        4,
        Blocks.NETHER_BRICK_FENCE.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);
    this.a(
        world,
        structureboundingbox,
        3,
        3,
        4,
        3,
        4,
        4,
        Blocks.NETHER_BRICK_FENCE.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);
    if (this.b
        && structureboundingbox.b(
            (BaseBlockPosition) (new BlockPosition(this.a(1, 3), this.d(2), this.b(1, 3))))) {
      this.b = false;
      this.a(
          world,
          structureboundingbox,
          random,
          1,
          2,
          3,
          WorldGenNetherPiece10.a,
          2 + random.nextInt(4));
    }

    this.a(
        world,
        structureboundingbox,
        0,
        6,
        0,
        4,
        6,
        4,
        Blocks.NETHER_BRICK.getBlockData(),
        Blocks.NETHER_BRICK.getBlockData(),
        false);

    for (int i = 0; i <= 4; ++i) {
      for (int j = 0; j <= 4; ++j) {
        this.b(world, Blocks.NETHER_BRICK.getBlockData(), i, -1, j, structureboundingbox);
      }
    }

    return true;
  }
  public boolean a(
      World paramWorld, Random paramRandom, StructureBoundingBox paramStructureBoundingBox) {
    if (a(paramWorld, paramStructureBoundingBox)) {
      return false;
    }

    int i = this.d * 5 - 1;

    a(paramWorld, paramStructureBoundingBox, 0, 0, 0, 2, 1, i, 0, 0, false);
    a(paramWorld, paramStructureBoundingBox, paramRandom, 0.8F, 0, 2, 0, 2, 2, i, 0, 0, false);

    if (this.b)
      a(
          paramWorld,
          paramStructureBoundingBox,
          paramRandom,
          0.6F,
          0,
          0,
          0,
          2,
          1,
          i,
          Block.WEB.id,
          0,
          false);
    int k;
    int m;
    for (int j = 0; j < this.d; j++) {
      k = 2 + j * 5;

      a(paramWorld, paramStructureBoundingBox, 0, 0, k, 0, 1, k, Block.FENCE.id, 0, false);
      a(paramWorld, paramStructureBoundingBox, 2, 0, k, 2, 1, k, Block.FENCE.id, 0, false);
      if (paramRandom.nextInt(4) != 0) {
        a(paramWorld, paramStructureBoundingBox, 0, 2, k, 2, 2, k, Block.WOOD.id, 0, false);
      } else {
        a(paramWorld, paramStructureBoundingBox, 0, 2, k, 0, 2, k, Block.WOOD.id, 0, false);
        a(paramWorld, paramStructureBoundingBox, 2, 2, k, 2, 2, k, Block.WOOD.id, 0, false);
      }
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.1F, 0, 2, k - 1, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.1F, 2, 2, k - 1, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.1F, 0, 2, k + 1, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.1F, 2, 2, k + 1, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.05F, 0, 2, k - 2, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.05F, 2, 2, k - 2, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.05F, 0, 2, k + 2, Block.WEB.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.05F, 2, 2, k + 2, Block.WEB.id, 0);

      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.05F, 1, 2, k - 1, Block.TORCH.id, 0);
      a(paramWorld, paramStructureBoundingBox, paramRandom, 0.05F, 1, 2, k + 1, Block.TORCH.id, 0);

      if (paramRandom.nextInt(100) == 0) {
        a(
            paramWorld,
            paramStructureBoundingBox,
            paramRandom,
            2,
            0,
            k - 1,
            WorldGenMineshaftPieces.a(),
            3 + paramRandom.nextInt(4));
      }
      if (paramRandom.nextInt(100) == 0) {
        a(
            paramWorld,
            paramStructureBoundingBox,
            paramRandom,
            0,
            0,
            k + 1,
            WorldGenMineshaftPieces.a(),
            3 + paramRandom.nextInt(4));
      }
      if ((this.b) && (!this.c)) {
        m = b(0);
        int n = k - 1 + paramRandom.nextInt(3);
        int i1 = a(1, n);
        n = b(1, n);
        if (paramStructureBoundingBox.b(i1, m, n)) {
          this.c = true;
          paramWorld.setTypeId(i1, m, n, Block.MOB_SPAWNER.id);
          TileEntityMobSpawner localTileEntityMobSpawner =
              (TileEntityMobSpawner) paramWorld.getTileEntity(i1, m, n);
          if (localTileEntityMobSpawner != null) localTileEntityMobSpawner.a("CaveSpider");
        }
      }
    }

    for (j = 0; j <= 2; j++) {
      for (k = 0; k <= i; k++) {
        m = a(paramWorld, j, -1, k, paramStructureBoundingBox);
        if (m == 0) {
          a(paramWorld, Block.WOOD.id, 0, j, -1, k, paramStructureBoundingBox);
        }
      }
    }

    if (this.a) {
      for (j = 0; j <= i; j++) {
        k = a(paramWorld, 1, -1, j, paramStructureBoundingBox);
        if ((k > 0) && (Block.n[k] != 0)) {
          a(
              paramWorld,
              paramStructureBoundingBox,
              paramRandom,
              0.7F,
              1,
              0,
              j,
              Block.RAILS.id,
              c(Block.RAILS.id, 0));
        }
      }
    }

    return true;
  }