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