Example #1
0
    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public override int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int i = areaX - 1;
        int j = areaY - 1;
        int k = areaWidth + 2;
        int l = areaHeight + 2;

        int[] aint  = parent.getInts(i, j, k, l);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i1 = 0; i1 < areaHeight; ++i1)
        {
            for (int j1 = 0; j1 < areaWidth; ++j1)
            {
                int k1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)];
                int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)];
                int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)];
                int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)];
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
                aint1[j1 + i1 * areaWidth] = k2;
                initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));

                if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && nextInt(2) == 0)
                {
                    aint1[j1 + i1 * areaWidth] = 1;
                }
            }
        }

        return(aint1);
    }
    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public override int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int i = areaX - 1;
        int j = areaY - 1;
        int k = areaWidth + 2;
        int l = areaHeight + 2;

        int[] aint  = this.parent.getInts(i, j, k, l);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i1 = 0; i1 < areaHeight; ++i1)
        {
            for (int j1 = 0; j1 < areaWidth; ++j1)
            {
                int k1 = aint[j1 + 0 + (i1 + 0) * k];
                int l1 = aint[j1 + 2 + (i1 + 0) * k];
                int i2 = aint[j1 + 0 + (i1 + 2) * k];
                int j2 = aint[j1 + 2 + (i1 + 2) * k];
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
                this.initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));

                if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && this.nextInt(100) == 0)
                {
                    aint1 [j1 + i1 * areaWidth] = BiomeGenBase.mushroomIsland.biomeID;
                }
                else
                {
                    aint1[j1 + i1 * areaWidth] = k2;
                }
            }
        }

        return(aint1);
    }
Example #3
0
        public override int[] getInts(int i, int j, int k, int l)
        {
            int[] ai  = parent.getInts(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < l; i1++)
            {
                for (int j1 = 0; j1 < k; j1++)
                {
                    initChunkSeed(j1 + i, i1 + j);
                    int k1 = ai[j1 + i1 * k];
                    if (k1 == 0)
                    {
                        ai1[j1 + i1 * k] = 0;
                        continue;
                    }
                    if (k1 == BiomeGenBase.mushroomIsland.biomeID)
                    {
                        ai1[j1 + i1 * k] = k1;
                        continue;
                    }
                    if (k1 == 1)
                    {
                        ai1[j1 + i1 * k] = allowedBiomes[nextInt(allowedBiomes.Length)].biomeID;
                    }
                    else
                    {
                        ai1[j1 + i1 * k] = BiomeGenBase.icePlains.biomeID;
                    }
                }
            }

            return(ai1);
        }
        /// <summary>
        /// Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
        /// amounts, or biomeList[] indices based on the particular GenLayer subclass.
        /// </summary>
        public override int[] GetInts(int par1, int par2, int par3, int par4)
        {
            int[] ai  = Parent.GetInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
            int[] ai1 = IntCache.GetIntCache(par3 * par4);

            for (int i = 0; i < par4; i++)
            {
                for (int j = 0; j < par3; j++)
                {
                    InitChunkSeed(j + par1, i + par2);
                    int k = ai[j + 1 + (i + 1) * (par3 + 2)];

                    if (k == BiomeGenBase.Swampland.BiomeID && NextInt(6) == 0)
                    {
                        ai1[j + i * par3] = BiomeGenBase.River.BiomeID;
                        continue;
                    }

                    if ((k == BiomeGenBase.Jungle.BiomeID || k == BiomeGenBase.JungleHills.BiomeID) && NextInt(8) == 0)
                    {
                        ai1[j + i * par3] = BiomeGenBase.River.BiomeID;
                    }
                    else
                    {
                        ai1[j + i * par3] = k;
                    }
                }
            }

            return(ai1);
        }
Example #5
0
    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public override int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int[] aint  = parent.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i = 0; i < areaHeight; ++i)
        {
            for (int j = 0; j < areaWidth; ++j)
            {
                this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
                int k = aint[j + 1 + (i + 1) * (areaWidth + 2)];

                if (nextInt(57) == 0)
                {
                    if (k == BiomeGenBase.plains.biomeID)
                    {
                        aint1[j + i * areaWidth] = BiomeGenBase.plains.biomeID + 128;
                    }
                    else
                    {
                        aint1[j + i * areaWidth] = k;
                    }
                }
                else
                {
                    aint1[j + i * areaWidth] = k;
                }
            }
        }

        return(aint1);
    }
Example #6
0
 public override int[] getInts(int i, int j, int k, int l)
 {
     int[] ai  = field_35512_b.getInts(i, j, k, l);
     int[] ai1 = field_35513_c.getInts(i, j, k, l);
     int[] ai2 = IntCache.getIntCache(k * l);
     for (int i1 = 0; i1 < k * l; i1++)
     {
         if (ai[i1] == BiomeGenBase.ocean.biomeID)
         {
             ai2[i1] = ai[i1];
             continue;
         }
         if (ai1[i1] >= 0)
         {
             if (ai[i1] == BiomeGenBase.icePlains.biomeID)
             {
                 ai2[i1] = BiomeGenBase.frozenRiver.biomeID;
                 continue;
             }
             if (ai[i1] == BiomeGenBase.mushroomIsland.biomeID || ai[i1] == BiomeGenBase.mushroomIslandShore.biomeID)
             {
                 ai2[i1] = BiomeGenBase.mushroomIslandShore.biomeID;
             }
             else
             {
                 ai2[i1] = ai1[i1];
             }
         }
         else
         {
             ai2[i1] = ai[i1];
         }
     }
     return(ai2);
 }
        public override int[] getInts(int i, int j, int k, int l)
        {
            int i1 = i - 1;
            int j1 = j - 1;
            int k1 = k + 2;
            int l1 = l + 2;

            int[] ai  = parent.getInts(i1, j1, k1, l1);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i2 = 0; i2 < l; i2++)
            {
                for (int j2 = 0; j2 < k; j2++)
                {
                    int k2 = ai[j2 + 0 + (i2 + 0) * k1];
                    int l2 = ai[j2 + 2 + (i2 + 0) * k1];
                    int i3 = ai[j2 + 0 + (i2 + 2) * k1];
                    int j3 = ai[j2 + 2 + (i2 + 2) * k1];
                    int k3 = ai[j2 + 1 + (i2 + 1) * k1];
                    initChunkSeed(j2 + i, i2 + j);
                    if (k3 == 0 && k2 == 0 && l2 == 0 && i3 == 0 && j3 == 0 && nextInt(100) == 0)
                    {
                        ai1[j2 + i2 * k] = BiomeGenBase.mushroomIsland.biomeID;
                    }
                    else
                    {
                        ai1[j2 + i2 * k] = k3;
                    }
                }
            }

            return(ai1);
        }
Example #8
0
    /**
     * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
     */
    public float[] getRainfall(float[] listToReuse, int x, int z, int width, int length)
    {
        IntCache.resetIntCache();

        if (listToReuse == null || listToReuse.Length < width * length)
        {
            listToReuse = new float[width * length];
        }

        int[] aint = this.biomeIndexLayer.getInts(x, z, width, length);

        for (int i = 0; i < width * length; ++i)
        {
            float f = (float)BiomeGenBase.getBiomeFromBiomeList(aint [i], BiomeGenBase.field_180279_ad).getIntRainfall() / 65536.0F;

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

            listToReuse [i] = f;
        }

        return(listToReuse);
    }
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2);
            int[] var6 = IntCache.getIntCache(par3 * par4);

            for (int var7 = 0; var7 < par4; ++var7)
            {
                for (int var8 = 0; var8 < par3; ++var8)
                {
                    this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
                    int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)];

                    if ((var9 != BiomeGenBase.swampland.biomeID || this.nextInt(6) != 0) && (var9 != BiomeGenBase.jungle.biomeID && var9 != BiomeGenBase.jungleHills.biomeID || this.nextInt(8) != 0))
                    {
                        var6[var8 + var7 * par3] = var9;
                    }
                    else
                    {
                        var6[var8 + var7 * par3] = BiomeGenBase.river.biomeID;
                    }
                }
            }

            return(var6);
        }
Example #10
0
        public override int[] getInts(int i, int j, int k, int l)
        {
            int[] ai  = parent.getInts(i - 1, j - 1, k + 2, l + 2);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < l; i1++)
            {
                for (int j1 = 0; j1 < k; j1++)
                {
                    initChunkSeed(j1 + i, i1 + j);
                    int k1 = ai[j1 + 1 + (i1 + 1) * (k + 2)];
                    if (k1 == BiomeGenBase.mushroomIsland.biomeID)
                    {
                        int l1 = ai[j1 + 1 + ((i1 + 1) - 1) * (k + 2)];
                        int i2 = ai[j1 + 1 + 1 + (i1 + 1) * (k + 2)];
                        int j2 = ai[((j1 + 1) - 1) + (i1 + 1) * (k + 2)];
                        int k2 = ai[j1 + 1 + (i1 + 1 + 1) * (k + 2)];
                        if (l1 == BiomeGenBase.ocean.biomeID || i2 == BiomeGenBase.ocean.biomeID || j2 == BiomeGenBase.ocean.biomeID || k2 == BiomeGenBase.ocean.biomeID)
                        {
                            ai1[j1 + i1 * k] = BiomeGenBase.mushroomIslandShore.biomeID;
                        }
                        else
                        {
                            ai1[j1 + i1 * k] = k1;
                        }
                    }
                    else
                    {
                        ai1[j1 + i1 * k] = k1;
                    }
                }
            }

            return(ai1);
        }
Example #11
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int var5 = par1 - 1;
            int var6 = par2 - 1;
            int var7 = par3 + 2;
            int var8 = par4 + 2;

            int[] var9  = this.parent.getInts(var5, var6, var7, var8);
            int[] var10 = IntCache.getIntCache(par3 * par4);

            for (int var11 = 0; var11 < par4; ++var11)
            {
                for (int var12 = 0; var12 < par3; ++var12)
                {
                    int var13 = var9[var12 + 0 + (var11 + 0) * var7];
                    int var14 = var9[var12 + 2 + (var11 + 0) * var7];
                    int var15 = var9[var12 + 0 + (var11 + 2) * var7];
                    int var16 = var9[var12 + 2 + (var11 + 2) * var7];
                    int var17 = var9[var12 + 1 + (var11 + 1) * var7];
                    this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2));

                    if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0)
                    {
                        var10[var12 + var11 * par3] = BiomeGenBase.mushroomIsland.biomeID;
                    }
                    else
                    {
                        var10[var12 + var11 * par3] = var17;
                    }
                }
            }

            return(var10);
        }
Example #12
0
        public void SetUp()
        {
            containingObject = new GameObject();
#pragma warning disable 0618
            subject = containingObject.AddComponent <IntCache>();
#pragma warning restore 0618
        }
        public override int[] func_35018_a(int i, int j, int k, int l)
        {
            int[] ai  = parent.func_35018_a(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < l; i1++)
            {
                for (int j1 = 0; j1 < k; j1++)
                {
                    func_35017_a(j1 + i, i1 + j);
                    int k1 = ai[j1 + i1 * k];
                    if (k1 == 0)
                    {
                        ai1[j1 + i1 * k] = 0;
                        continue;
                    }
                    if (k1 == BiomeGenBase.mushroomIsland.biomeID)
                    {
                        ai1[j1 + i1 * k] = k1;
                        continue;
                    }
                    if (k1 == 1)
                    {
                        ai1[j1 + i1 * k] = field_35029_b[nextInt(field_35029_b.Length)].biomeID;
                    }
                    else
                    {
                        ai1[j1 + i1 * k] = BiomeGenBase.icePlains.biomeID;
                    }
                }
            }

            return(ai1);
        }
Example #14
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int i = par1 - 1;
            int j = par2 - 1;
            int k = par3 + 2;
            int l = par4 + 2;

            int[] ai  = parent.getInts(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(par3 * par4);

            for (int i1 = 0; i1 < par4; i1++)
            {
                for (int j1 = 0; j1 < par3; j1++)
                {
                    int k1 = ai[j1 + 0 + (i1 + 0) * k];
                    int l1 = ai[j1 + 2 + (i1 + 0) * k];
                    int i2 = ai[j1 + 0 + (i1 + 2) * k];
                    int j2 = ai[j1 + 2 + (i1 + 2) * k];
                    int k2 = ai[j1 + 1 + (i1 + 1) * k];
                    initChunkSeed(j1 + par1, i1 + par2);

                    if (k2 == 0 && k1 == 0 && l1 == 0 && i2 == 0 && j2 == 0 && nextInt(100) == 0)
                    {
                        ai1[j1 + i1 * par3] = BiomeGenBase.mushroomIsland.biomeID;
                    }
                    else
                    {
                        ai1[j1 + i1 * par3] = k2;
                    }
                }
            }

            return(ai1);
        }
Example #15
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int[] var5 = this.biomePatternGeneratorChain.getInts(par1, par2, par3, par4);
            int[] var6 = this.riverPatternGeneratorChain.getInts(par1, par2, par3, par4);
            int[] var7 = IntCache.getIntCache(par3 * par4);

            for (int var8 = 0; var8 < par3 * par4; ++var8)
            {
                if (var5[var8] == BiomeGenBase.ocean.biomeID)
                {
                    var7[var8] = var5[var8];
                }
                else if (var6[var8] >= 0)
                {
                    if (var5[var8] == BiomeGenBase.icePlains.biomeID)
                    {
                        var7[var8] = BiomeGenBase.frozenRiver.biomeID;
                    }
                    else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID)
                    {
                        var7[var8] = var6[var8];
                    }
                    else
                    {
                        var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID;
                    }
                }
                else
                {
                    var7[var8] = var5[var8];
                }
            }

            return(var7);
        }
Example #16
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int var5 = par1 - 1;
            int var6 = par2 - 1;
            int var7 = par3 + 2;
            int var8 = par4 + 2;

            int[] var9  = this.parent.getInts(var5, var6, var7, var8);
            int[] var10 = IntCache.getIntCache(par3 * par4);

            for (int var11 = 0; var11 < par4; ++var11)
            {
                for (int var12 = 0; var12 < par3; ++var12)
                {
                    int var13 = var9[var12 + 0 + (var11 + 1) * var7];
                    int var14 = var9[var12 + 2 + (var11 + 1) * var7];
                    int var15 = var9[var12 + 1 + (var11 + 0) * var7];
                    int var16 = var9[var12 + 1 + (var11 + 2) * var7];
                    int var17 = var9[var12 + 1 + (var11 + 1) * var7];

                    if (var17 != 0 && var13 != 0 && var14 != 0 && var15 != 0 && var16 != 0 && var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16)
                    {
                        var10[var12 + var11 * par3] = -1;
                    }
                    else
                    {
                        var10[var12 + var11 * par3] = BiomeGenBase.river.biomeID;
                    }
                }
            }

            return(var10);
        }
Example #17
0
        public override int[] func_35018_a(int i, int j, int k, int l)
        {
            int i1 = i - 1;
            int j1 = j - 1;
            int k1 = k + 2;
            int l1 = l + 2;

            int[] ai  = parent.func_35018_a(i1, j1, k1, l1);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i2 = 0; i2 < l; i2++)
            {
                for (int j2 = 0; j2 < k; j2++)
                {
                    int k2 = ai[j2 + 1 + (i2 + 1) * k1];
                    func_35017_a(j2 + i, i2 + j);
                    if (k2 == 0)
                    {
                        ai1[j2 + i2 * k] = 0;
                        continue;
                    }
                    int l2 = nextInt(5);
                    if (l2 == 0)
                    {
                        l2 = BiomeGenBase.icePlains.biomeID;
                    }
                    else
                    {
                        l2 = 1;
                    }
                    ai1[j2 + i2 * k] = l2;
                }
            }

            return(ai1);
        }
Example #18
0
    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public override int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int i = areaX - 1;
        int j = areaY - 1;
        int k = areaWidth + 2;
        int l = areaHeight + 2;

        int[] aint  = this.parent.getInts(i, j, k, l);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i1 = 0; i1 < areaHeight; ++i1)
        {
            for (int j1 = 0; j1 < areaWidth; ++j1)
            {
                int k1 = this.func_151630_c(aint[j1 + 0 + (i1 + 1) * k]);
                int l1 = this.func_151630_c(aint[j1 + 2 + (i1 + 1) * k]);
                int i2 = this.func_151630_c(aint[j1 + 1 + (i1 + 0) * k]);
                int j2 = this.func_151630_c(aint[j1 + 1 + (i1 + 2) * k]);
                int k2 = this.func_151630_c(aint[j1 + 1 + (i1 + 1) * k]);

                if (k2 == k1 && k2 == i2 && k2 == l1 && k2 == j2)
                {
                    aint1[j1 + i1 * areaWidth] = -1;
                }
                else
                {
                    aint1[j1 + i1 * areaWidth] = BiomeGenBase.river.biomeID;
                }
            }
        }

        return(aint1);
    }
Example #19
0
        public override int[] func_35018_a(int i, int j, int k, int l)
        {
            int[] ai  = parent.func_35018_a(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < k * l; i1++)
            {
                ai1[i1] = BiomeGenBase.biomeList[ai[i1]].func_35510_e();
            }

            return(ai1);
        }
Example #20
0
    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public override int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int i = areaX - 1;
        int j = areaY - 1;
        int k = areaWidth + 2;
        int l = areaHeight + 2;

        int[] aint  = parent.getInts(i, j, k, l);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i1 = 0; i1 < areaHeight; ++i1)
        {
            for (int j1 = 0; j1 < areaWidth; ++j1)
            {
                int k1 = aint[j1 + 1 + (i1 + 1 - 1) * (areaWidth + 2)];
                int l1 = aint[j1 + 1 + 1 + (i1 + 1) * (areaWidth + 2)];
                int i2 = aint[j1 + 1 - 1 + (i1 + 1) * (areaWidth + 2)];
                int j2 = aint[j1 + 1 + (i1 + 1 + 1) * (areaWidth + 2)];
                int k2 = aint[j1 + 1 + (i1 + 1) * k];
                int l2 = 0;

                if (k1 == 0)
                {
                    ++l2;
                }

                if (l1 == 0)
                {
                    ++l2;
                }

                if (i2 == 0)
                {
                    ++l2;
                }

                if (j2 == 0)
                {
                    ++l2;
                }

                if (k2 == 0 && l2 > 3)
                {
                    aint1[j1 + i1 * areaWidth] = BiomeGenBase.deepOcean.biomeID;
                }
                else
                {
                    aint1[j1 + i1 * areaWidth] = k2;
                }
            }
        }

        return(aint1);
    }
Example #21
0
 private void  Init()
 {
     _byteCache        = new ByteCache(this);
     _shortCache       = new ShortCache(this);
     _intCache         = new IntCache(this);
     _floatCache       = new FloatCache(this);
     _longCache        = new LongCache(this);
     _doubleCache      = new DoubleCache(this);
     _stringCache      = new StringCache(this);
     _stringIndexCache = new StringIndexCache(this);
 }
 public override int[] func_35500_a(int i, int j, int k, int l)
 {
     int[] ai  = parent.func_35500_a(i, j, k, l);
     int[] ai1 = field_35505_b.func_35500_a(i, j, k, l);
     int[] ai2 = IntCache.getIntCache(k * l);
     for (int i1 = 0; i1 < k * l; i1++)
     {
         ai2[i1] = ai1[i1] + (BiomeGenBase.biomeList[ai[i1]].func_35474_f() - ai1[i1]) / (field_35506_c * 2 + 1);
     }
     return(ai2);
 }
Example #23
0
        public override int[] getInts(int i, int j, int k, int l)
        {
            int[] ai  = parent.getInts(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < k * l; i1++)
            {
                ai1[i1] = BiomeGenBase.biomeList[ai[i1]].getIntRainfall();
            }

            return(ai1);
        }
Example #24
0
        public override int[] getInts(int i, int j, int k, int l)
        {
            int[] ai  = parent.getInts(i, j, k, l);
            int[] ai1 = field_35507_b.getInts(i, j, k, l);
            int[] ai2 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < k * l; i1++)
            {
                ai2[i1] = ai1[i1] + (BiomeGenBase.biomeList[ai[i1]].getIntRainfall() - ai1[i1]) / (field_35508_c + 1);
            }

            return(ai2);
        }
Example #25
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int var5 = par1 - 1;
            int var6 = par2 - 1;
            int var7 = par3 + 2;
            int var8 = par4 + 2;

            int[] var9  = this.parent.getInts(var5, var6, var7, var8);
            int[] var10 = IntCache.getIntCache(par3 * par4);

            for (int var11 = 0; var11 < par4; ++var11)
            {
                for (int var12 = 0; var12 < par3; ++var12)
                {
                    int var13 = var9[var12 + 0 + (var11 + 1) * var7];
                    int var14 = var9[var12 + 2 + (var11 + 1) * var7];
                    int var15 = var9[var12 + 1 + (var11 + 0) * var7];
                    int var16 = var9[var12 + 1 + (var11 + 2) * var7];
                    int var17 = var9[var12 + 1 + (var11 + 1) * var7];

                    if (var13 == var14 && var15 == var16)
                    {
                        this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2));

                        if (this.nextInt(2) == 0)
                        {
                            var17 = var13;
                        }
                        else
                        {
                            var17 = var15;
                        }
                    }
                    else
                    {
                        if (var13 == var14)
                        {
                            var17 = var13;
                        }

                        if (var15 == var16)
                        {
                            var17 = var15;
                        }
                    }

                    var10[var12 + var11 * par3] = var17;
                }
            }

            return(var10);
        }
Example #26
0
        public override int[] getInts(int par1, int par2, int par3, int par4)
        {
            int i = par1 - 1;
            int j = par2 - 1;
            int k = par3 + 2;
            int l = par4 + 2;

            int[] ai  = parent.getInts(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(par3 * par4);

            for (int i1 = 0; i1 < par4; i1++)
            {
                for (int j1 = 0; j1 < par3; j1++)
                {
                    int k1 = ai[j1 + 0 + (i1 + 1) * k];
                    int l1 = ai[j1 + 2 + (i1 + 1) * k];
                    int i2 = ai[j1 + 1 + (i1 + 0) * k];
                    int j2 = ai[j1 + 1 + (i1 + 2) * k];
                    int k2 = ai[j1 + 1 + (i1 + 1) * k];

                    if (k1 == l1 && i2 == j2)
                    {
                        initChunkSeed(j1 + par1, i1 + par2);

                        if (nextInt(2) == 0)
                        {
                            k2 = k1;
                        }
                        else
                        {
                            k2 = i2;
                        }
                    }
                    else
                    {
                        if (k1 == l1)
                        {
                            k2 = k1;
                        }

                        if (i2 == j2)
                        {
                            k2 = i2;
                        }
                    }

                    ai1[j1 + i1 * par3] = k2;
                }
            }

            return(ai1);
        }
Example #27
0
    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public override int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
    {
        int i = areaX - 1;
        int j = areaY - 1;
        int k = areaWidth + 2;
        int l = areaHeight + 2;

        int[] aint  = parent.getInts(i, j, k, l);
        int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i1 = 0; i1 < areaHeight; ++i1)
        {
            for (int j1 = 0; j1 < areaWidth; ++j1)
            {
                int k1 = aint[j1 + 0 + (i1 + 1) * k];
                int l1 = aint[j1 + 2 + (i1 + 1) * k];
                int i2 = aint[j1 + 1 + (i1 + 0) * k];
                int j2 = aint[j1 + 1 + (i1 + 2) * k];
                int k2 = aint[j1 + 1 + (i1 + 1) * k];

                if (k1 == l1 && i2 == j2)
                {
                    initChunkSeed((long)(j1 + areaX), (long)(i1 + areaY));

                    if (this.nextInt(2) == 0)
                    {
                        k2 = k1;
                    }
                    else
                    {
                        k2 = i2;
                    }
                }
                else
                {
                    if (k1 == l1)
                    {
                        k2 = k1;
                    }

                    if (i2 == j2)
                    {
                        k2 = i2;
                    }
                }

                aint1[j1 + i1 * areaWidth] = k2;
            }
        }

        return(aint1);
    }
Example #28
0
 private void  Init()
 {
     lock (this)
     {
         caches = new HashMap<Type, Cache>(7);
         caches[typeof(sbyte)] = new ByteCache(this);
         caches[typeof(short)] = new ShortCache(this);
         caches[typeof(int)] = new IntCache(this);
         caches[typeof(float)] = new FloatCache(this);
         caches[typeof(long)] = new LongCache(this);
         caches[typeof(double)] = new DoubleCache(this);
         caches[typeof(string)] = new StringCache(this);
         caches[typeof(StringIndex)] = new StringIndexCache(this);
     }
 }
Example #29
0
        public override int[] getInts(int i, int j, int k, int l)
        {
            int[] ai  = parent.getInts(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < l; i1++)
            {
                for (int j1 = 0; j1 < k; j1++)
                {
                    initChunkSeed(j1 + i, i1 + j);
                    ai1[j1 + i1 * k] = ai[j1 + i1 * k] <= 0 ? 0 : nextInt(2) + 2;
                }
            }

            return(ai1);
        }
 private void  Init()
 {
     lock (this)
     {
         caches = new HashMap <Type, Cache>(7);
         caches[typeof(sbyte)]       = new ByteCache(this);
         caches[typeof(short)]       = new ShortCache(this);
         caches[typeof(int)]         = new IntCache(this);
         caches[typeof(float)]       = new FloatCache(this);
         caches[typeof(long)]        = new LongCache(this);
         caches[typeof(double)]      = new DoubleCache(this);
         caches[typeof(string)]      = new StringCache(this);
         caches[typeof(StringIndex)] = new StringIndexCache(this);
     }
 }
Example #31
0
        public override int[] func_35500_a(int i, int j, int k, int l)
        {
            int[] ai  = parent.func_35500_a(i, j, k, l);
            int[] ai1 = IntCache.getIntCache(k * l);
            for (int i1 = 0; i1 < l; i1++)
            {
                for (int j1 = 0; j1 < k; j1++)
                {
                    func_35499_a(j1 + i, i1 + j);
                    ai1[j1 + i1 * k] = ai[j1 + i1 * k] <= 0 ? 0 : nextInt(2) + 2;
                }
            }

            return(ai1);
        }
		private void  Init()
		{
			lock (this)
			{
                Support.Dictionary<Type, Cache> caches2 = new Support.Dictionary<Type, Cache>();
                caches2[typeof(sbyte)] = new ByteCache(this);
                caches2[typeof(short)] = new ShortCache(this);
                caches2[typeof(int)] = new IntCache(this);
                caches2[typeof(float)] = new FloatCache(this);
                caches2[typeof(long)] = new LongCache(this);
                caches2[typeof(double)] = new DoubleCache(this);
                caches2[typeof(string)] = new StringCache(this);
                caches2[typeof(StringIndex)] = new StringIndexCache(this);
                caches2[typeof(System.IComparable)] = new CustomCache(this);
                caches2[typeof(System.Object)] = new AutoCache(this);
                caches = caches2;
			}
		}