    001    package net.minecraft.src;
    002
    003    public class GenLayerAddIsland extends GenLayer
    004    {
    005        public GenLayerAddIsland(long par1, GenLayer par3GenLayer)
    006        {
    007            super(par1);
    008            this.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 var5 = par1 - 1;
    018            int var6 = par2 - 1;
    019            int var7 = par3 + 2;
    020            int var8 = par4 + 2;
    021            int[] var9 = this.parent.getInts(var5, var6, var7, var8);
    022            int[] var10 = IntCache.getIntCache(par3 * par4);
    023
    024            for (int var11 = 0; var11 < par4; ++var11)
    025            {
    026                for (int var12 = 0; var12 < par3; ++var12)
    027                {
    028                    int var13 = var9[var12 + 0 + (var11 + 0) * var7];
    029                    int var14 = var9[var12 + 2 + (var11 + 0) * var7];
    030                    int var15 = var9[var12 + 0 + (var11 + 2) * var7];
    031                    int var16 = var9[var12 + 2 + (var11 + 2) * var7];
    032                    int var17 = var9[var12 + 1 + (var11 + 1) * var7];
    033                    this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2));
    034
    035                    if (var17 == 0 && (var13 != 0 || var14 != 0 || var15 != 0 || var16 != 0))
    036                    {
    037                        int var18 = 1;
    038                        int var19 = 1;
    039
    040                        if (var13 != 0 && this.nextInt(var18++) == 0)
    041                        {
    042                            var19 = var13;
    043                        }
    044
    045                        if (var14 != 0 && this.nextInt(var18++) == 0)
    046                        {
    047                            var19 = var14;
    048                        }
    049
    050                        if (var15 != 0 && this.nextInt(var18++) == 0)
    051                        {
    052                            var19 = var15;
    053                        }
    054
    055                        if (var16 != 0 && this.nextInt(var18++) == 0)
    056                        {
    057                            var19 = var16;
    058                        }
    059
    060                        if (this.nextInt(3) == 0)
    061                        {
    062                            var10[var12 + var11 * par3] = var19;
    063                        }
    064                        else if (var19 == BiomeGenBase.icePlains.biomeID)
    065                        {
    066                            var10[var12 + var11 * par3] = BiomeGenBase.frozenOcean.biomeID;
    067                        }
    068                        else
    069                        {
    070                            var10[var12 + var11 * par3] = 0;
    071                        }
    072                    }
    073                    else if (var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0))
    074                    {
    075                        if (this.nextInt(5) == 0)
    076                        {
    077                            if (var17 == BiomeGenBase.icePlains.biomeID)
    078                            {
    079                                var10[var12 + var11 * par3] = BiomeGenBase.frozenOcean.biomeID;
    080                            }
    081                            else
    082                            {
    083                                var10[var12 + var11 * par3] = 0;
    084                            }
    085                        }
    086                        else
    087                        {
    088                            var10[var12 + var11 * par3] = var17;
    089                        }
    090                    }
    091                    else
    092                    {
    093                        var10[var12 + var11 * par3] = var17;
    094                    }
    095                }
    096            }
    097
    098            return var10;
    099        }
    100    }