public void recreateStructures(int par1, int par2) {
    Iterator var3 = this.structureGenerators.iterator();

    while (var3.hasNext()) {
      MapGenStructure var4 = (MapGenStructure) var3.next();
      var4.generate(this, this.worldObj, par1, par2, (byte[]) null);
    }
  }
  /** Populates chunk with ores etc etc */
  public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
    int var4 = par2 * 16;
    int var5 = par3 * 16;
    BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
    boolean var7 = false;
    this.random.setSeed(this.worldObj.getSeed());
    long var8 = this.random.nextLong() / 2L * 2L + 1L;
    long var10 = this.random.nextLong() / 2L * 2L + 1L;
    this.random.setSeed((long) par2 * var8 + (long) par3 * var10 ^ this.worldObj.getSeed());
    Iterator var12 = this.structureGenerators.iterator();

    while (var12.hasNext()) {
      MapGenStructure var13 = (MapGenStructure) var12.next();
      boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.random, par2, par3);

      if (var13 instanceof MapGenVillage) {
        var7 |= var14;
      }
    }

    int var17;
    int var16;
    int var18;

    if (this.waterLakeGenerator != null && !var7 && this.random.nextInt(4) == 0) {
      var16 = var4 + this.random.nextInt(16) + 8;
      var17 = this.random.nextInt(128);
      var18 = var5 + this.random.nextInt(16) + 8;
      this.waterLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18);
    }

    if (this.lavaLakeGenerator != null && !var7 && this.random.nextInt(8) == 0) {
      var16 = var4 + this.random.nextInt(16) + 8;
      var17 = this.random.nextInt(this.random.nextInt(120) + 8);
      var18 = var5 + this.random.nextInt(16) + 8;

      if (var17 < 63 || this.random.nextInt(10) == 0) {
        this.lavaLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18);
      }
    }

    if (this.field_82702_h) {
      for (var16 = 0; var16 < 8; ++var16) {
        var17 = var4 + this.random.nextInt(16) + 8;
        var18 = this.random.nextInt(128);
        int var15 = var5 + this.random.nextInt(16) + 8;
        (new WorldGenDungeons()).generate(this.worldObj, this.random, var17, var18, var15);
      }
    }

    if (this.field_82697_g) {
      var6.decorate(this.worldObj, this.random, var4, var5);
    }
  }
  /**
   * Returns the location of the closest structure of the specified type. If not found returns null.
   */
  public ChunkPosition findClosestStructure(
      World par1World, String par2Str, int par3, int par4, int par5) {
    if ("Stronghold".equals(par2Str)) {
      Iterator var6 = this.structureGenerators.iterator();

      while (var6.hasNext()) {
        MapGenStructure var7 = (MapGenStructure) var6.next();

        if (var7 instanceof MapGenStronghold) {
          return var7.getNearestInstance(par1World, par3, par4, par5);
        }
      }
    }

    return null;
  }
  /**
   * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the
   * blocks for the specified chunk from the map seed and chunk seed
   */
  public Chunk provideChunk(int par1, int par2) {
    Chunk var3 = new Chunk(this.worldObj, par1, par2);

    for (int var4 = 0; var4 < this.field_82700_c.length; ++var4) {
      int var5 = var4 >> 4;
      ExtendedBlockStorage var6 = var3.getBlockStorageArray()[var5];

      if (var6 == null) {
        var6 = new ExtendedBlockStorage(var4, !this.worldObj.provider.hasNoSky);
        var3.getBlockStorageArray()[var5] = var6;
      }

      for (int var7 = 0; var7 < 16; ++var7) {
        for (int var8 = 0; var8 < 16; ++var8) {
          var6.setExtBlockID(var7, var4 & 15, var8, this.field_82700_c[var4] & 255);
          var6.setExtBlockMetadata(var7, var4 & 15, var8, this.field_82698_d[var4]);
        }
      }
    }

    var3.generateSkylightMap();
    BiomeGenBase[] var9 =
        this.worldObj
            .getWorldChunkManager()
            .loadBlockGeneratorData((BiomeGenBase[]) null, par1 * 16, par2 * 16, 16, 16);
    byte[] var10 = var3.getBiomeArray();

    for (int var11 = 0; var11 < var10.length; ++var11) {
      var10[var11] = (byte) var9[var11].biomeID;
    }

    Iterator var12 = this.structureGenerators.iterator();

    while (var12.hasNext()) {
      MapGenStructure var13 = (MapGenStructure) var12.next();
      var13.generate(this, this.worldObj, par1, par2, (byte[]) null);
    }

    var3.generateSkylightMap();
    return var3;
  }