    001    package net.minecraft.world.gen.layer;
    002
    003    public class GenLayerVoronoiZoom extends GenLayer
    004    {
    005        public GenLayerVoronoiZoom(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            par1 -= 2;
    018            par2 -= 2;
    019            byte var5 = 2;
    020            int var6 = 1 << var5;
    021            int var7 = par1 >> var5;
    022            int var8 = par2 >> var5;
    023            int var9 = (par3 >> var5) + 3;
    024            int var10 = (par4 >> var5) + 3;
    025            int[] var11 = this.parent.getInts(var7, var8, var9, var10);
    026            int var12 = var9 << var5;
    027            int var13 = var10 << var5;
    028            int[] var14 = IntCache.getIntCache(var12 * var13);
    029            int var16;
    030
    031            for (int var15 = 0; var15 < var10 - 1; ++var15)
    032            {
    033                var16 = var11[0 + (var15 + 0) * var9];
    034                int var17 = var11[0 + (var15 + 1) * var9];
    035
    036                for (int var18 = 0; var18 < var9 - 1; ++var18)
    037                {
    038                    double var19 = (double)var6 * 0.9D;
    039                    this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 << var5));
    040                    double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
    041                    double var23 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
    042                    this.initChunkSeed((long)(var18 + var7 + 1 << var5), (long)(var15 + var8 << var5));
    043                    double var25 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
    044                    double var27 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
    045                    this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 + 1 << var5));
    046                    double var29 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
    047                    double var31 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
    048                    this.initChunkSeed((long)(var18 + var7 + 1 << var5), (long)(var15 + var8 + 1 << var5));
    049                    double var33 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
    050                    double var35 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
    051                    int var37 = var11[var18 + 1 + (var15 + 0) * var9];
    052                    int var38 = var11[var18 + 1 + (var15 + 1) * var9];
    053
    054                    for (int var39 = 0; var39 < var6; ++var39)
    055                    {
    056                        int var40 = ((var15 << var5) + var39) * var12 + (var18 << var5);
    057
    058                        for (int var41 = 0; var41 < var6; ++var41)
    059                        {
    060                            double var42 = ((double)var39 - var23) * ((double)var39 - var23) + ((double)var41 - var21) * ((double)var41 - var21);
    061                            double var44 = ((double)var39 - var27) * ((double)var39 - var27) + ((double)var41 - var25) * ((double)var41 - var25);
    062                            double var46 = ((double)var39 - var31) * ((double)var39 - var31) + ((double)var41 - var29) * ((double)var41 - var29);
    063                            double var48 = ((double)var39 - var35) * ((double)var39 - var35) + ((double)var41 - var33) * ((double)var41 - var33);
    064
    065                            if (var42 < var44 && var42 < var46 && var42 < var48)
    066                            {
    067                                var14[var40++] = var16;
    068                            }
    069                            else if (var44 < var42 && var44 < var46 && var44 < var48)
    070                            {
    071                                var14[var40++] = var37;
    072                            }
    073                            else if (var46 < var42 && var46 < var44 && var46 < var48)
    074                            {
    075                                var14[var40++] = var17;
    076                            }
    077                            else
    078                            {
    079                                var14[var40++] = var38;
    080                            }
    081                        }
    082                    }
    083
    084                    var16 = var37;
    085                    var17 = var38;
    086                }
    087            }
    088
    089            int[] var50 = IntCache.getIntCache(par3 * par4);
    090
    091            for (var16 = 0; var16 < par4; ++var16)
    092            {
    093                System.arraycopy(var14, (var16 + (par2 & var6 - 1)) * (var9 << var5) + (par1 & var6 - 1), var50, var16 * par3, par3);
    094            }
    095
    096            return var50;
    097        }
    098    }