Beispiel #1
0
        public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)
        {
            IntCache.resetIntCache();

            if (par1ArrayOfFloat == null || par1ArrayOfFloat.Length < par4 * par5)
            {
                par1ArrayOfFloat = new float[par4 * par5];
            }

            int[] var6 = this.biomeIndexLayer.getInts(par2, par3, par4, par5);

            for (int var7 = 0; var7 < par4 * par5; ++var7)
            {
                float var8 = (float)BiomeGenBase.biomeList[var6[var7]].getIntTemperature() / 65536.0F;

                if (var8 > 1.0F)
                {
                    var8 = 1.0F;
                }

                par1ArrayOfFloat[var7] = var8;
            }

            return(par1ArrayOfFloat);
        }
Beispiel #2
0
        public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, bool par6)
        {
            IntCache.resetIntCache();

            if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.Length < par4 * par5)
            {
                par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
            }

            if (par6 && par4 == 16 && par5 == 16 && (par2 & 15) == 0 && (par3 & 15) == 0)
            {
                BiomeGenBase[] var9 = this.biomeCache.getCachedBiomes(par2, par3);
                Array.Copy(var9, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
                return(par1ArrayOfBiomeGenBase);
            }
            else
            {
                int[] var7 = this.biomeIndexLayer.getInts(par2, par3, par4, par5);

                for (int var8 = 0; var8 < par4 * par5; ++var8)
                {
                    par1ArrayOfBiomeGenBase[var8] = BiomeGenBase.biomeList[var7[var8]];
                }

                return(par1ArrayOfBiomeGenBase);
            }
        }
Beispiel #3
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int var5 = par1 >> 1;
            int var6 = par2 >> 1;
            int var7 = (par3 >> 1) + 3;
            int var8 = (par4 >> 1) + 3;

            int[] var9  = this.parent.getInts(var5, var6, var7, var8);
            int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2);
            int   var11 = var7 << 1;
            int   var13;

            for (int var12 = 0; var12 < var8 - 1; ++var12)
            {
                var13 = var12 << 1;
                int var14 = var13 * var11;
                int var15 = var9[0 + (var12 + 0) * var7];
                int var16 = var9[0 + (var12 + 1) * var7];

                for (int var17 = 0; var17 < var7 - 1; ++var17)
                {
                    this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1));
                    int var18 = var9[var17 + 1 + (var12 + 0) * var7];
                    int var19 = var9[var17 + 1 + (var12 + 1) * var7];
                    var10[var14]           = var15;
                    var10[var14++ + var11] = this.choose(var15, var16);
                    var10[var14]           = this.choose(var15, var18);
                    var10[var14++ + var11] = this.func_75916_b(var15, var18, var16, var19);
                    var15 = var18;
                    var16 = var19;
                }
            }

            int[] var20 = IntCache.getIntCache(par3 * par4);

            for (var13 = 0; var13 < par4; ++var13)
            {
                Array.Copy(var10, (var13 + (par2 & 1)) * (var7 << 1) + (par1 & 1), var20, var13 * par3, par3);
            }

            return(var20);
        }
Beispiel #4
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            par1 -= 2;
            par2 -= 2;
            byte var5  = 2;
            int  var6  = 1 << var5;
            int  var7  = par1 >> var5;
            int  var8  = par2 >> var5;
            int  var9  = (par3 >> var5) + 3;
            int  var10 = (par4 >> var5) + 3;

            int[] var11 = this.parent.getInts(var7, var8, var9, var10);
            int   var12 = var9 << var5;
            int   var13 = var10 << var5;

            int[] var14 = IntCache.getIntCache(var12 * var13);
            int   var16;

            for (int var15 = 0; var15 < var10 - 1; ++var15)
            {
                var16 = var11[0 + (var15 + 0) * var9];
                int var17 = var11[0 + (var15 + 1) * var9];

                for (int var18 = 0; var18 < var9 - 1; ++var18)
                {
                    double var19 = (double)var6 * 0.9D;
                    this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 << var5));
                    double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
                    double var23 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
                    this.initChunkSeed((long)(var18 + var7 + 1 << var5), (long)(var15 + var8 << var5));
                    double var25 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
                    double var27 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
                    this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 + 1 << var5));
                    double var29 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19;
                    double var31 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
                    this.initChunkSeed((long)(var18 + var7 + 1 << var5), (long)(var15 + var8 + 1 << var5));
                    double var33 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
                    double var35 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19 + (double)var6;
                    int    var37 = var11[var18 + 1 + (var15 + 0) * var9];
                    int    var38 = var11[var18 + 1 + (var15 + 1) * var9];

                    for (int var39 = 0; var39 < var6; ++var39)
                    {
                        int var40 = ((var15 << var5) + var39) * var12 + (var18 << var5);

                        for (int var41 = 0; var41 < var6; ++var41)
                        {
                            double var42 = ((double)var39 - var23) * ((double)var39 - var23) + ((double)var41 - var21) * ((double)var41 - var21);
                            double var44 = ((double)var39 - var27) * ((double)var39 - var27) + ((double)var41 - var25) * ((double)var41 - var25);
                            double var46 = ((double)var39 - var31) * ((double)var39 - var31) + ((double)var41 - var29) * ((double)var41 - var29);
                            double var48 = ((double)var39 - var35) * ((double)var39 - var35) + ((double)var41 - var33) * ((double)var41 - var33);

                            if (var42 < var44 && var42 < var46 && var42 < var48)
                            {
                                var14[var40++] = var16;
                            }
                            else if (var44 < var42 && var44 < var46 && var44 < var48)
                            {
                                var14[var40++] = var37;
                            }
                            else if (var46 < var42 && var46 < var44 && var46 < var48)
                            {
                                var14[var40++] = var17;
                            }
                            else
                            {
                                var14[var40++] = var38;
                            }
                        }
                    }

                    var16 = var37;
                    var17 = var38;
                }
            }

            int[] var50 = IntCache.getIntCache(par3 * par4);

            for (var16 = 0; var16 < par4; ++var16)
            {
                Array.Copy(var14, (var16 + (par2 & var6 - 1)) * (var9 << var5) + (par1 & var6 - 1), var50, var16 * par3, par3);
            }

            return(var50);
        }