    001package net.minecraft.world.gen.layer;
    002
    003import net.minecraft.world.WorldType;
    004import net.minecraft.world.biome.BiomeGenBase;
    005
    006public class GenLayerBiome extends GenLayer
    007{
    008    /** this sets all the biomes that are allowed to appear in the overworld */
    009    private BiomeGenBase[] allowedBiomes;
    010
    011    public GenLayerBiome(long par1, GenLayer par3GenLayer, WorldType par4WorldType)
    012    {
    013        super(par1);
    014        this.allowedBiomes = par4WorldType.getBiomesForWorldType();
    015        this.parent = par3GenLayer;
    016    }
    017
    018    /**
    019     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
    020     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
    021     */
    022    public int[] getInts(int par1, int par2, int par3, int par4)
    023    {
    024        int[] var5 = this.parent.getInts(par1, par2, par3, par4);
    025        int[] var6 = IntCache.getIntCache(par3 * par4);
    026
    027        for (int var7 = 0; var7 < par4; ++var7)
    028        {
    029            for (int var8 = 0; var8 < par3; ++var8)
    030            {
    031                this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
    032                int var9 = var5[var8 + var7 * par3];
    033
    034                if (var9 == 0)
    035                {
    036                    var6[var8 + var7 * par3] = 0;
    037                }
    038                else if (var9 == BiomeGenBase.mushroomIsland.biomeID)
    039                {
    040                    var6[var8 + var7 * par3] = var9;
    041                }
    042                else if (var9 == 1)
    043                {
    044                    var6[var8 + var7 * par3] = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID;
    045                }
    046                else
    047                {
    048                    int var10 = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID;
    049
    050                    if (var10 == BiomeGenBase.taiga.biomeID)
    051                    {
    052                        var6[var8 + var7 * par3] = var10;
    053                    }
    054                    else
    055                    {
    056                        var6[var8 + var7 * par3] = BiomeGenBase.icePlains.biomeID;
    057                    }
    058                }
    059            }
    060        }
    061
    062        return var6;
    063    }
    064}