    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 var5 = par1 - 1;
    020        int var6 = par2 - 1;
    021        int var7 = par3 + 2;
    022        int var8 = par4 + 2;
    023        int[] var9 = this.parent.getInts(var5, var6, var7, var8);
    024        int[] var10 = IntCache.getIntCache(par3 * par4);
    025
    026        for (int var11 = 0; var11 < par4; ++var11)
    027        {
    028            for (int var12 = 0; var12 < par3; ++var12)
    029            {
    030                int var13 = var9[var12 + 1 + (var11 + 1) * var7];
    031                this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2));
    032
    033                if (var13 == 0)
    034                {
    035                    var10[var12 + var11 * par3] = 0;
    036                }
    037                else
    038                {
    039                    int var14 = this.nextInt(5);
    040
    041                    if (var14 == 0)
    042                    {
    043                        var14 = BiomeGenBase.icePlains.biomeID;
    044                    }
    045                    else
    046                    {
    047                        var14 = 1;
    048                    }
    049
    050                    var10[var12 + var11 * par3] = var14;
    051                }
    052            }
    053        }
    054
    055        return var10;
    056    }
    057}