// Path: src/main/java/com/github/dayzminecraft/dayzminecraft/common/world/IWorldType.java
// public interface IWorldType {
// 
//   /**
//    * Returns an array of large, "major" biomes, such as forest, desert, or taiga in the overworld.
//    */
//   BiomeGenBase[] setMajorBiomes();
// 
//   /**
//    * Returns a "minor" biome based on conditions of modder's choosing. Examples of such biomes in the overworld include
//    * the hilly or mountainous areas within larger biomes such as tundra or jungle, as well as the splotches of forest
//    * across the plains.
//    */
//   BiomeGenBase setMinorBiomes(BiomeGenBase biome, GenLayer genLayer);
// 
//   /**
//    * Returns a biome generated in the pattern of overworld oceans; note that this does not mean the biome generated is
//    * or must be an actual ocean biome.
//    *
//    * @params See the "setMinorBiomes" method.
//    */
//   BiomeGenBase setOceanBiomes(BiomeGenBase biome, GenLayer genLayer);
// 
//   /**
//    * Returns a biome generated in the pattern of overworld rivers; note that this does not mean the biome generated is
//    * or must be an actual river biome.
//    *
//    * @params See the "setMinorBiomes" method.
//    */
//   BiomeGenBase setRiverBiomes(BiomeGenBase biome, GenLayer genLayer);
// 
//   /**
//    * Returns a biome generated consistently along the border of two separate biomes.
//    */
//   BiomeGenBase setBorderBiomes(BiomeGenBase biome1, BiomeGenBase biome2, GenLayer genLayer);
// 
//   /**
//    * Returns a biome that can be generated anywhere; only the rarity of the biome, not its generation overtop of other
//    * biomes, can be defined.
//    */
//   BiomeGenBase setMiscellaneousBiomes(GenLayer genLayer);
// }


import com.github.dayzminecraft.dayzminecraft.common.world.IWorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
package com.github.dayzminecraft.dayzminecraft.common.world.genlayer;


public class GenLayerDayZMiscBiome extends GenLayer {
  private IWorldType worldType;

  public GenLayerDayZMiscBiome(long l, GenLayer genlayer, IWorldType worldtype) {
    super(l);
    parent = genlayer;
    worldType = worldtype;
  }

  @Override
  public int[] getInts(int par1, int par2, int par3, int par4) {
    int i = par1 - 1;
    int j = par2 - 1;
    int k = par3 + 2;
    int l = par4 + 2;
    int ai[] = parent.getInts(i, j, k, l);
    int ai1[] = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; i1++) {
      for (int j1 = 0; j1 < par3; j1++) {
        int k2 = ai[j1 + 1 + (i1 + 1) * k];
        initChunkSeed(j1 + par1, i1 + par2);

        BiomeGenBase biome = worldType.setMiscellaneousBiomes(this);
        if (biome != null) {
// Path: src/main/java/com/github/dayzminecraft/dayzminecraft/common/world/IWorldType.java
// public interface IWorldType {
// 
//   /**
//    * Returns an array of large, "major" biomes, such as forest, desert, or taiga in the overworld.
//    */
//   BiomeGenBase[] setMajorBiomes();
// 
//   /**
//    * Returns a "minor" biome based on conditions of modder's choosing. Examples of such biomes in the overworld include
//    * the hilly or mountainous areas within larger biomes such as tundra or jungle, as well as the splotches of forest
//    * across the plains.
//    */
//   BiomeGenBase setMinorBiomes(BiomeGenBase biome, GenLayer genLayer);
// 
//   /**
//    * Returns a biome generated in the pattern of overworld oceans; note that this does not mean the biome generated is
//    * or must be an actual ocean biome.
//    *
//    * @params See the "setMinorBiomes" method.
//    */
//   BiomeGenBase setOceanBiomes(BiomeGenBase biome, GenLayer genLayer);
// 
//   /**
//    * Returns a biome generated in the pattern of overworld rivers; note that this does not mean the biome generated is
//    * or must be an actual river biome.
//    *
//    * @params See the "setMinorBiomes" method.
//    */
//   BiomeGenBase setRiverBiomes(BiomeGenBase biome, GenLayer genLayer);
// 
//   /**
//    * Returns a biome generated consistently along the border of two separate biomes.
//    */
//   BiomeGenBase setBorderBiomes(BiomeGenBase biome1, BiomeGenBase biome2, GenLayer genLayer);
// 
//   /**
//    * Returns a biome that can be generated anywhere; only the rarity of the biome, not its generation overtop of other
//    * biomes, can be defined.
//    */
//   BiomeGenBase setMiscellaneousBiomes(GenLayer genLayer);
// }


// Path: src/main/java/com/github/dayzminecraft/dayzminecraft/common/world/genlayer/GenLayerDayZMiscBiome.java
import com.github.dayzminecraft.dayzminecraft.common.world.IWorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;

package com.github.dayzminecraft.dayzminecraft.common.world.genlayer;


public class GenLayerDayZMiscBiome extends GenLayer {
  private IWorldType worldType;

  public GenLayerDayZMiscBiome(long l, GenLayer genlayer, IWorldType worldtype) {
    super(l);
    parent = genlayer;
    worldType = worldtype;
  }

  @Override
  public int[] getInts(int par1, int par2, int par3, int par4) {
    int i = par1 - 1;
    int j = par2 - 1;
    int k = par3 + 2;
    int l = par4 + 2;
    int ai[] = parent.getInts(i, j, k, l);
    int ai1[] = IntCache.getIntCache(par3 * par4);

    for (int i1 = 0; i1 < par4; i1++) {
      for (int j1 = 0; j1 < par3; j1++) {
        int k2 = ai[j1 + 1 + (i1 + 1) * k];
        initChunkSeed(j1 + par1, i1 + par2);

        BiomeGenBase biome = worldType.setMiscellaneousBiomes(this);
        if (biome != null) {
          ai1[j1 + i1 * par3] = biome.biomeID;