    001package net.minecraft.world.gen.layer;
    002
    003import net.minecraft.world.biome.BiomeGenBase;
    004
    005public class GenLayerAddSnow extends GenLayer
    006{
    007    public GenLayerAddSnow(long par1, GenLayer par3GenLayer)
    008    {
    009        super(par1);
    010        this.parent = par3GenLayer;
    011    }
    012
    013    /**
    014     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
    015     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
    016     */
    017    public int[] getInts(int par1, int par2, int par3, int par4)
    018    {
    019        int i1 = par1 - 1;
    020        int j1 = par2 - 1;
    021        int k1 = par3 + 2;
    022        int l1 = par4 + 2;
    023        int[] aint = this.parent.getInts(i1, j1, k1, l1);
    024        int[] aint1 = IntCache.getIntCache(par3 * par4);
    025
    026        for (int i2 = 0; i2 < par4; ++i2)
    027        {
    028            for (int j2 = 0; j2 < par3; ++j2)
    029            {
    030                int k2 = aint[j2 + 1 + (i2 + 1) * k1];
    031                this.initChunkSeed((long)(j2 + par1), (long)(i2 + par2));
    032
    033                if (k2 == 0)
    034                {
    035                    aint1[j2 + i2 * par3] = 0;
    036                }
    037                else
    038                {
    039                    int l2 = this.nextInt(5);
    040
    041                    if (l2 == 0)
    042                    {
    043                        l2 = BiomeGenBase.icePlains.biomeID;
    044                    }
    045                    else
    046                    {
    047                        l2 = 1;
    048                    }
    049
    050                    aint1[j2 + i2 * par3] = l2;
    051                }
    052            }
    053        }
    054
    055        return aint1;
    056    }
    057}