Exemple #1
0
    protected static bool biomesEqualOrMesaPlateau(int biomeIDA, int biomeIDB)
    {
        if (biomeIDA == biomeIDB)
        {
            return(true);
        }
        else if (biomeIDA != BiomeGenBase.mesaPlateau_F.biomeID && biomeIDA != BiomeGenBase.mesaPlateau.biomeID)
        {
            BiomeGenBase biomegenbase  = BiomeGenBase.getBiome(biomeIDA);
            BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(biomeIDB);

            return((biomegenbase != null && biomegenbase1 != null) ? biomegenbase.isEqualTo(biomegenbase1) : false);
        }
        else
        {
            return(biomeIDB == BiomeGenBase.mesaPlateau_F.biomeID || biomeIDB == BiomeGenBase.mesaPlateau.biomeID);
        }
    }
Exemple #2
0
    /**
     * Returns if two biomes can logically be neighbors. If one is hot and the other cold, for example, it returns
     * false.
     */
    private bool canBiomesBeNeighbors(int p_151634_1_, int p_151634_2_)
    {
        if (biomesEqualOrMesaPlateau(p_151634_1_, p_151634_2_))
        {
            return(true);
        }
        else
        {
            BiomeGenBase biomegenbase  = BiomeGenBase.getBiome(p_151634_1_);
            BiomeGenBase biomegenbase1 = BiomeGenBase.getBiome(p_151634_2_);

            if (biomegenbase != null && biomegenbase1 != null)
            {
                BiomeGenBase.TempCategory biomegenbase_tempcategory  = biomegenbase.getTempCategory();
                BiomeGenBase.TempCategory biomegenbase_tempcategory1 = biomegenbase1.getTempCategory();
                return(biomegenbase_tempcategory == biomegenbase_tempcategory1 || biomegenbase_tempcategory == BiomeGenBase.TempCategory.MEDIUM || biomegenbase_tempcategory1 == BiomeGenBase.TempCategory.MEDIUM);
            }
            else
            {
                return(false);
            }
        }
    }
Exemple #3
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 = field_151628_d.getInts(areaX - 1, areaY - 1, areaWidth + 2, areaHeight + 2);
        int[] aint2 = IntCache.getIntCache(areaWidth * areaHeight);

        for (int i = 0; i < areaHeight; ++i)
        {
            for (int j = 0; j < areaWidth; ++j)
            {
                initChunkSeed((long)(j + areaX), (long)(i + areaY));
                int  k    = aint[j + 1 + (i + 1) * (areaWidth + 2)];
                int  l    = aint1[j + 1 + (i + 1) * (areaWidth + 2)];
                bool flag = (l - 2) % 29 == 0;

                if (k > 255)
                {
                    Debug.LogFormat("old! " + k);
                }

                if (k != 0 && l >= 2 && (l - 2) % 29 == 1 && k < 128)
                {
                    if (BiomeGenBase.getBiome(k + 128) != null)
                    {
                        aint2[j + i * areaWidth] = k + 128;
                    }
                    else
                    {
                        aint2[j + i * areaWidth] = k;
                    }
                }
                else if (this.nextInt(3) != 0 && !flag)
                {
                    aint2[j + i * areaWidth] = k;
                }
                else
                {
                    int i1 = k;

                    if (k == BiomeGenBase.desert.biomeID)
                    {
                        i1 = BiomeGenBase.desertHills.biomeID;
                    }
                    else if (k == BiomeGenBase.forest.biomeID)
                    {
                        i1 = BiomeGenBase.forestHills.biomeID;
                    }
                    else if (k == BiomeGenBase.birchForest.biomeID)
                    {
                        i1 = BiomeGenBase.birchForestHills.biomeID;
                    }
                    else if (k == BiomeGenBase.roofedForest.biomeID)
                    {
                        i1 = BiomeGenBase.plains.biomeID;
                    }
                    else if (k == BiomeGenBase.taiga.biomeID)
                    {
                        i1 = BiomeGenBase.taigaHills.biomeID;
                    }
                    else if (k == BiomeGenBase.megaTaiga.biomeID)
                    {
                        i1 = BiomeGenBase.megaTaigaHills.biomeID;
                    }
                    else if (k == BiomeGenBase.coldTaiga.biomeID)
                    {
                        i1 = BiomeGenBase.coldTaigaHills.biomeID;
                    }
                    else if (k == BiomeGenBase.plains.biomeID)
                    {
                        if (this.nextInt(3) == 0)
                        {
                            i1 = BiomeGenBase.forestHills.biomeID;
                        }
                        else
                        {
                            i1 = BiomeGenBase.forest.biomeID;
                        }
                    }
                    else if (k == BiomeGenBase.icePlains.biomeID)
                    {
                        i1 = BiomeGenBase.iceMountains.biomeID;
                    }
                    else if (k == BiomeGenBase.jungle.biomeID)
                    {
                        i1 = BiomeGenBase.jungleHills.biomeID;
                    }
                    else if (k == BiomeGenBase.ocean.biomeID)
                    {
                        i1 = BiomeGenBase.deepOcean.biomeID;
                    }
                    else if (k == BiomeGenBase.extremeHills.biomeID)
                    {
                        i1 = BiomeGenBase.extremeHillsPlus.biomeID;
                    }
                    else if (k == BiomeGenBase.savanna.biomeID)
                    {
                        i1 = BiomeGenBase.savannaPlateau.biomeID;
                    }
                    else if (biomesEqualOrMesaPlateau(k, BiomeGenBase.mesaPlateau_F.biomeID))
                    {
                        i1 = BiomeGenBase.mesa.biomeID;
                    }
                    else if (k == BiomeGenBase.deepOcean.biomeID && nextInt(3) == 0)
                    {
                        int j1 = this.nextInt(2);

                        if (j1 == 0)
                        {
                            i1 = BiomeGenBase.plains.biomeID;
                        }
                        else
                        {
                            i1 = BiomeGenBase.forest.biomeID;
                        }
                    }

                    if (flag && i1 != k)
                    {
                        if (BiomeGenBase.getBiome(i1 + 128) != null)
                        {
                            i1 += 128;
                        }
                        else
                        {
                            i1 = k;
                        }
                    }

                    if (i1 == k)
                    {
                        aint2[j + i * areaWidth] = k;
                    }
                    else
                    {
                        int k2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
                        int k1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
                        int l1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
                        int i2 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];
                        int j2 = 0;

                        if (biomesEqualOrMesaPlateau(k2, k))
                        {
                            ++j2;
                        }

                        if (biomesEqualOrMesaPlateau(k1, k))
                        {
                            ++j2;
                        }

                        if (biomesEqualOrMesaPlateau(l1, k))
                        {
                            ++j2;
                        }

                        if (biomesEqualOrMesaPlateau(i2, k))
                        {
                            ++j2;
                        }

                        if (j2 >= 3)
                        {
                            aint2[j + i * areaWidth] = i1;
                        }
                        else
                        {
                            aint2[j + i * areaWidth] = k;
                        }
                    }
                }
            }
        }

        return(aint2);
    }
Exemple #4
0
 private bool func_151633_d(int p_151633_1_)
 {
     return(BiomeGenBase.getBiome(p_151633_1_).GetType().ToString() == "BiomeGenMesa");
 }
Exemple #5
0
 private bool func_151631_c(int p_151631_1_)
 {
     return(BiomeGenBase.getBiome(p_151631_1_) != null && BiomeGenBase.getBiome(p_151631_1_).GetType().ToString() == "BiomeGenJungle" ? true : p_151631_1_ == BiomeGenBase.jungleEdge.biomeID || p_151631_1_ == BiomeGenBase.jungle.biomeID || p_151631_1_ == BiomeGenBase.jungleHills.biomeID || p_151631_1_ == BiomeGenBase.forest.biomeID || p_151631_1_ == BiomeGenBase.taiga.biomeID || isBiomeOceanic(p_151631_1_));
 }
Exemple #6
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)
            {
                initChunkSeed((long)(j + areaX), (long)(i + areaY));
                int          k            = aint[j + 1 + (i + 1) * (areaWidth + 2)];
                BiomeGenBase biomegenbase = BiomeGenBase.getBiome(k);

                if (k == BiomeGenBase.mushroomIsland.biomeID)
                {
                    int j2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
                    int i3 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
                    int l3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
                    int k4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];

                    if (j2 != BiomeGenBase.ocean.biomeID && i3 != BiomeGenBase.ocean.biomeID && l3 != BiomeGenBase.ocean.biomeID && k4 != BiomeGenBase.ocean.biomeID)
                    {
                        aint1[j + i * areaWidth] = k;
                    }
                    else
                    {
                        aint1[j + i * areaWidth] = BiomeGenBase.mushroomIslandShore.biomeID;
                    }
                }
                else if (biomegenbase != null && biomegenbase.GetType().ToString() == "BiomeGenJungle")
                {
                    int i2 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
                    int l2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
                    int k3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
                    int j4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];

                    if (this.func_151631_c(i2) && this.func_151631_c(l2) && this.func_151631_c(k3) && this.func_151631_c(j4))
                    {
                        if (!isBiomeOceanic(i2) && !isBiomeOceanic(l2) && !isBiomeOceanic(k3) && !isBiomeOceanic(j4))
                        {
                            aint1[j + i * areaWidth] = k;
                        }
                        else
                        {
                            aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID;
                        }
                    }
                    else
                    {
                        aint1[j + i * areaWidth] = BiomeGenBase.jungleEdge.biomeID;
                    }
                }
                else if (k != BiomeGenBase.extremeHills.biomeID && k != BiomeGenBase.extremeHillsPlus.biomeID && k != BiomeGenBase.extremeHillsEdge.biomeID)
                {
                    if (biomegenbase != null && biomegenbase.isSnowyBiome())
                    {
                        this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.coldBeach.biomeID);
                    }
                    else if (k != BiomeGenBase.mesa.biomeID && k != BiomeGenBase.mesaPlateau_F.biomeID)
                    {
                        if (k != BiomeGenBase.ocean.biomeID && k != BiomeGenBase.deepOcean.biomeID && k != BiomeGenBase.river.biomeID && k != BiomeGenBase.swampland.biomeID)
                        {
                            int l1 = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
                            int k2 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
                            int j3 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
                            int i4 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];

                            if (!isBiomeOceanic(l1) && !isBiomeOceanic(k2) && !isBiomeOceanic(j3) && !isBiomeOceanic(i4))
                            {
                                aint1[j + i * areaWidth] = k;
                            }
                            else
                            {
                                aint1[j + i * areaWidth] = BiomeGenBase.beach.biomeID;
                            }
                        }
                        else
                        {
                            aint1[j + i * areaWidth] = k;
                        }
                    }
                    else
                    {
                        int l  = aint[j + 1 + (i + 1 - 1) * (areaWidth + 2)];
                        int i1 = aint[j + 1 + 1 + (i + 1) * (areaWidth + 2)];
                        int j1 = aint[j + 1 - 1 + (i + 1) * (areaWidth + 2)];
                        int k1 = aint[j + 1 + (i + 1 + 1) * (areaWidth + 2)];

                        if (!isBiomeOceanic(l) && !isBiomeOceanic(i1) && !isBiomeOceanic(j1) && !isBiomeOceanic(k1))
                        {
                            if (this.func_151633_d(l) && this.func_151633_d(i1) && this.func_151633_d(j1) && this.func_151633_d(k1))
                            {
                                aint1[j + i * areaWidth] = k;
                            }
                            else
                            {
                                aint1[j + i * areaWidth] = BiomeGenBase.desert.biomeID;
                            }
                        }
                        else
                        {
                            aint1[j + i * areaWidth] = k;
                        }
                    }
                }
                else
                {
                    this.func_151632_a(aint, aint1, j, i, areaWidth, k, BiomeGenBase.stoneBeach.biomeID);
                }
            }
        }

        return(aint1);
    }