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