    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[] aint = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
    020        int[] aint1 = IntCache.getIntCache(par3 * par4);
    021
    022        for (int i1 = 0; i1 < par4; ++i1)
    023        {
    024            for (int j1 = 0; j1 < par3; ++j1)
    025            {
    026                this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
    027                int k1 = aint[j1 + 1 + (i1 + 1) * (par3 + 2)];
    028
    029                if (this.nextInt(3) == 0)
    030                {
    031                    int l1 = k1;
    032
    033                    if (k1 == BiomeGenBase.desert.biomeID)
    034                    {
    035                        l1 = BiomeGenBase.desertHills.biomeID;
    036                    }
    037                    else if (k1 == BiomeGenBase.forest.biomeID)
    038                    {
    039                        l1 = BiomeGenBase.forestHills.biomeID;
    040                    }
    041                    else if (k1 == BiomeGenBase.taiga.biomeID)
    042                    {
    043                        l1 = BiomeGenBase.taigaHills.biomeID;
    044                    }
    045                    else if (k1 == BiomeGenBase.plains.biomeID)
    046                    {
    047                        l1 = BiomeGenBase.forest.biomeID;
    048                    }
    049                    else if (k1 == BiomeGenBase.icePlains.biomeID)
    050                    {
    051                        l1 = BiomeGenBase.iceMountains.biomeID;
    052                    }
    053                    else if (k1 == BiomeGenBase.jungle.biomeID)
    054                    {
    055                        l1 = BiomeGenBase.jungleHills.biomeID;
    056                    }
    057
    058                    if (l1 == k1)
    059                    {
    060                        aint1[j1 + i1 * par3] = k1;
    061                    }
    062                    else
    063                    {
    064                        int i2 = aint[j1 + 1 + (i1 + 1 - 1) * (par3 + 2)];
    065                        int j2 = aint[j1 + 1 + 1 + (i1 + 1) * (par3 + 2)];
    066                        int k2 = aint[j1 + 1 - 1 + (i1 + 1) * (par3 + 2)];
    067                        int l2 = aint[j1 + 1 + (i1 + 1 + 1) * (par3 + 2)];
    068
    069                        if (i2 == k1 && j2 == k1 && k2 == k1 && l2 == k1)
    070                        {
    071                            aint1[j1 + i1 * par3] = l1;
    072                        }
    073                        else
    074                        {
    075                            aint1[j1 + i1 * par3] = k1;
    076                        }
    077                    }
    078                }
    079                else
    080                {
    081                    aint1[j1 + i1 * par3] = k1;
    082                }
    083            }
    084        }
    085
    086        return aint1;
    087    }
    088}