    001package net.minecraft.world.gen.layer;
    002
    003import net.minecraft.world.biome.BiomeGenBase;
    004
    005public class GenLayerHills extends GenLayer
    006{
    007    public GenLayerHills(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 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
    020        int[] var6 = IntCache.getIntCache(par3 * par4);
    021
    022        for (int var7 = 0; var7 < par4; ++var7)
    023        {
    024            for (int var8 = 0; var8 < par3; ++var8)
    025            {
    026                this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
    027                int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)];
    028
    029                if (this.nextInt(3) == 0)
    030                {
    031                    int var10 = var9;
    032
    033                    if (var9 == BiomeGenBase.desert.biomeID)
    034                    {
    035                        var10 = BiomeGenBase.desertHills.biomeID;
    036                    }
    037                    else if (var9 == BiomeGenBase.forest.biomeID)
    038                    {
    039                        var10 = BiomeGenBase.forestHills.biomeID;
    040                    }
    041                    else if (var9 == BiomeGenBase.taiga.biomeID)
    042                    {
    043                        var10 = BiomeGenBase.taigaHills.biomeID;
    044                    }
    045                    else if (var9 == BiomeGenBase.plains.biomeID)
    046                    {
    047                        var10 = BiomeGenBase.forest.biomeID;
    048                    }
    049                    else if (var9 == BiomeGenBase.icePlains.biomeID)
    050                    {
    051                        var10 = BiomeGenBase.iceMountains.biomeID;
    052                    }
    053                    else if (var9 == BiomeGenBase.jungle.biomeID)
    054                    {
    055                        var10 = BiomeGenBase.jungleHills.biomeID;
    056                    }
    057
    058                    if (var10 == var9)
    059                    {
    060                        var6[var8 + var7 * par3] = var9;
    061                    }
    062                    else
    063                    {
    064                        int var11 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)];
    065                        int var12 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)];
    066                        int var13 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)];
    067                        int var14 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)];
    068
    069                        if (var11 == var9 && var12 == var9 && var13 == var9 && var14 == var9)
    070                        {
    071                            var6[var8 + var7 * par3] = var10;
    072                        }
    073                        else
    074                        {
    075                            var6[var8 + var7 * par3] = var9;
    076                        }
    077                    }
    078                }
    079                else
    080                {
    081                    var6[var8 + var7 * par3] = var9;
    082                }
    083            }
    084        }
    085
    086        return var6;
    087    }
    088}