Jump to content

Recommended Posts

Posted

Hi there,

 

My biome is working so far, and i'm trying to find my way to generate my dimension without using the base classes BiomeGenBase & BiomeDecorator, so far i got my biome te decorate and to spawn in my custom dimension (which generates like the nether).

I would like to have 2 or more biomes to spawn in my custom dimension. How to do that?

 

I am using forge v 7.7.1.611 and Mcp 7.44.

 

I am also having troubles with the use of a customBiomeDecorator.

i have tried the following things:

- Searched a lot of forums/tutorials about 2 or more biomes to spawn in your dimension, haven't found anything about it so far.

- Found a tutorial about a customBiomeDecorator, followed it but didn't still work.

(with the normal BiomeDecorator it all worked fine aswell)

- I now have placed the "WorldGen.generate();" inside the chunkprovider but if i wan't to use more biomes this wouldn't work well, or is there anyway you can do a biomeid check or something?

 

These are my files:

 

mod_Ores

 

  Reveal hidden contents

 

 

BiomeGenSoulForest

 

  Reveal hidden contents

 

 

ChunkProviderMarona

 

  Reveal hidden contents

 

 

WorldProviderMarona

 

  Reveal hidden contents

 

 

Thanks for reading and thanks for your time.

Please help me i'm still trying out different stuff but i would really appreciate your help, even if it is just an idea or a link to a different post.

 

Every bits help!

Posted

I did look into this and did some searching, most of the statements I found was like this:

  Quote
Pain inn the ass hard

I refuse to believe that it's that hard, it's all about commitment ;)

 

I did find one thread which had some useful information, maybe it could help you on your way?

http://www.minecraftforge.net/forum/index.php?topic=3331.0

The last post at least seems to lead to a good read :)

It's quite recent so go take a look :)

 

Edit: The github seems to have been moved, I guess this is the current location but it wasn't too easy to navigate the folder names: https://github.com/tuyapin/MinecraftMods

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

biome decorator is not what generates the various biomes, it just decorates them.... I would assume you would need the custom chunkprovider, custom worldprovider, and then you would need to modify the GenLayer and stuff like that, clone the overworld regular field and start tweaking from there.

  • 2 weeks later...
Posted

Unfortunately i haven't gotten this to work :( still.

 

I don't have to make a custom WorldChunkManager, GenLayer (+ all subGenLayer), WorldType, WorldTypeEvent, IntCache, BiomeCacheBlock, BiomeCache etc would i?

 

I also found out that i could use the list of the normal worldchunkmanager and delete biomes using Forge's .removeBiome(""); But that also deletes it from the overworld. I have tried several things to fix this but i haven't gotten it to work properly with loads of "NullPointerExceptions" and "Exception Ticking World".

Posted
  On 5/18/2013 at 5:13 PM, OwnAgePau said:

Unfortunately i haven't gotten this to work :( still.

 

I don't have to make a custom WorldChunkManager, GenLayer (+ all subGenLayer), WorldType, WorldTypeEvent, IntCache, BiomeCacheBlock, BiomeCache etc would i?

I believe you do, sadly. At least, that's what I had to do when I made my "Dig Deeper!" mod. I'll give you some of the basic stuff from my MCM here.

 

public class WorldChunkManagerDeeper extends WorldChunkManager
{
    private GenLayer genBiomes;

    /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
    private GenLayer biomeIndexLayer;

    /** The BiomeCache object for this world. */
    private BiomeCacheDeeper biomeCache;

    /** A list of biomes that the player can spawn in. */
    private List biomesToSpawnIn;

    protected WorldChunkManagerDeeper()
    {
        biomeCache = new BiomeCacheDeeper(this);
        biomesToSpawnIn = new ArrayList();
        biomesToSpawnIn.add(BiomeGenBase.forest);

        biomesToSpawnIn.add(BiomeGenBase.jungleHills);
    }

    public WorldChunkManagerDeeper(long par1, WorldType par3WorldType)
    {
        this();
        GenLayer agenlayer[] = GenLayer.initializeAllBiomeGenerators(par1, par3WorldType);
        genBiomes = agenlayer[0];
        biomeIndexLayer = agenlayer[1];
    }

    public WorldChunkManagerDeeper(World par1World)
    {
        this(par1World.getSeed(), par1World.getWorldInfo().getTerrainType());
    }

    /**
     * Gets the list of valid biomes for the player to spawn in.
     */
    public List getBiomesToSpawnIn()
    {
        return biomesToSpawnIn;
    }

    /**
     * Returns the BiomeGenBase related to the x, z position on the world.
     */
    public BiomeGenBase getBiomeGenAt(int par1, int par2)
    {
        return biomeCache.getBiomeGenAt(par1, par2);
    }

    /**
     * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.
     */
    public float[] getRainfall(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 ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);

        for (int i = 0; i < par4 * par5; i++)
        {
            float f = (float)BiomeGenBase.biomeList[ai[i]].getIntRainfall() / 65536F;

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

            par1ArrayOfFloat[i] = f;
        }

        return par1ArrayOfFloat;
    }

    /**
     * Return an adjusted version of a given temperature based on the y height
     */
    public float getTemperatureAtHeight(float par1, int par2)
    {
        return par1;
    }

    /**
     * Returns a list of temperatures to use for the specified blocks.  Args: listToReuse, x, y, width, length
     */
    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 ai[] = biomeIndexLayer.getInts(par2, par3, par4, par5);

        for (int i = 0; i < par4 * par5; i++)
        {
            float f = (float)BiomeGenBase.biomeList[ai[i]].getIntTemperature() / 65536F;

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

            par1ArrayOfFloat[i] = f;
        }

        return par1ArrayOfFloat;
    }

    /**
     * Returns an array of biomes for the location input.
     */
    public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5)
    {
        IntCache.resetIntCache();

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

        int ai[] = genBiomes.getInts(par2, par3, par4, par5);

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

        return par1ArrayOfBiomeGenBase;
    }

    /**
     * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the
     * WorldChunkManager Args: oldBiomeList, x, z, width, depth
     */
    public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5)
    {
        return getBiomeGenAt(par1ArrayOfBiomeGenBase, par2, par3, par4, par5, true);
    }

    /**
     * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
     * don't check biomeCache to avoid infinite loop in BiomeCacheBlock)
     */
    public BiomeGenBase[] getBiomeGenAt(BiomeGenBase par1ArrayOfBiomeGenBase[], int par2, int par3, int par4, int par5, boolean par6)
    {
        IntCache.resetIntCache();

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

        if (par6 && par4 == 16 && par5 == 16 && (par2 & 0xf) == 0 && (par3 & 0xf) == 0)
        {
            BiomeGenBase abiomegenbase[] = biomeCache.getCachedBiomes(par2, par3);
            System.arraycopy(abiomegenbase, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
            return par1ArrayOfBiomeGenBase;
        }

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

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

        return par1ArrayOfBiomeGenBase;
    }

    /**
     * checks given Chunk's Biomes against List of allowed ones
     */
    public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
    {
        int i = par1 - par3 >> 2;
        int j = par2 - par3 >> 2;
        int k = par1 + par3 >> 2;
        int l = par2 + par3 >> 2;
        int i1 = (k - i) + 1;
        int j1 = (l - j) + 1;
        int ai[] = genBiomes.getInts(i, j, i1, j1);

        for (int k1 = 0; k1 < i1 * j1; k1++)
        {
            BiomeGenBase biomegenbase = BiomeGenBase.biomeList[ai[k1]];

            if (!par4List.contains(biomegenbase))
            {
                return false;
            }
        }

        return true;
    }

    /**
     * Finds a valid position within a range, that is once of the listed biomes.
     */
    public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
    {
        int i = par1 - par3 >> 2;
        int j = par2 - par3 >> 2;
        int k = par1 + par3 >> 2;
        int l = par2 + par3 >> 2;
        int i1 = (k - i) + 1;
        int j1 = (l - j) + 1;
        int ai[] = genBiomes.getInts(i, j, i1, j1);
        ChunkPosition chunkposition = null;
        int k1 = 0;

        for (int l1 = 0; l1 < ai.length; l1++)
        {
            int i2 = i + l1 % i1 << 2;
            int j2 = j + l1 / i1 << 2;
            BiomeGenBase biomegenbase = BiomeGenBase.biomeList[ai[l1]];

            if (par4List.contains(biomegenbase) && (chunkposition == null || par5Random.nextInt(k1 + 1) == 0))
            {
                chunkposition = new ChunkPosition(i2, 0, j2);
                k1++;
            }
        }

        return chunkposition;
    }

    /**
     * Calls the WorldChunkManager's biomeCache.cleanupCache()
     */
    public void cleanupCache()
    {
        biomeCache.cleanupCache();
    }
}

width=300 height=100http://i.imgur.com/ivK3J.png[/img]

I'm a little surprised that I am still ranked as a "Forge Modder," having not posted a single mod since my animals mod... I have to complete Digging Deeper!, fast!

Posted
  Quote
I think you want Forge code, not Minecraft code.

Otherwise it would be a jar mod.

 

EDIT: Where did you get your code?

 

Well first of all if you know how to add multiple biomes to your custom dimension then please tell us.

 

You say i shouldn't use minecraft code but that doesn't make any sense in any way. Although it is true that i should not code inside the minecraft base classes which i ofcourse try to avoid. I am not sure if you mean that by "jar mod".

  • 1 month later...
Posted

The way i have managed to get it done is by having custom worldchunkmanager in  WorldType or WorldProvider depending if you are making dimension or a worldtype.

The worldchunkmanager is mostly untouched it just points to the custom genLayer.

The GenLayerBiome decides what biomes gets generated you should tell it where it can find your custom BiomeGenBase[] array.

 

and remember to register your worldprovider or worldtype with forge too :)

Posted
  On 6/26/2013 at 10:55 PM, StormTiberius said:

The way i have managed to get it done is by having custom worldchunkmanager in  WorldType or WorldProvider depending if you are making dimension or a worldtype.

That. I have no explanation to help you with, but in making my own dimension, I wanted all of the vanilla overworld biomes to spawn in my dimension. The 2 world chunk managers I know of are WorldChunkManager and WorldChunkManagerHell. The Hell one does one biome, which you specify. The regular one does multiple. You will have to make your own world chunk manager and look in to how the regular one works.

Read my thoughts on my summer mod work and tell me what you think!

http://www.minecraftforge.net/forum/index.php/topic,8396.0.html

 

I absolutely love her when she smiles

  • 1 year later...
Posted

Blade your reply worked, just note with 1.7.1+ you need to do some changes as per : http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-updating-1-6-to-1-7-part-1-modfile-and-recipes/#sthash.9BCseiYx.dpbs

 

Basically, biomeList becomes getBiomeGenArray()

as well as getIntTemperature() changes to getFloatTemperature() with additional parameters.

 

As per original answer, I managed to get multiple biomes on a custom dimension with modding ChunkProvider, WorldProvider, WorldChunkManager

Posted
  On 2/25/2015 at 7:07 AM, Xackery said:

Blade your reply worked, just note with 1.7.1+ you need to do some changes as per : http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-updating-1-6-to-1-7-part-1-modfile-and-recipes/#sthash.9BCseiYx.dpbs

 

Basically, biomeList becomes getBiomeGenArray()

as well as getIntTemperature() changes to getFloatTemperature() with additional parameters.

 

As per original answer, I managed to get multiple biomes on a custom dimension with modding ChunkProvider, WorldProvider, WorldChunkManager

Dude, this thread is 2 years old... Make your own if you need help.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.