Jump to content

How can I simulate the End chunk providing?


LousyLynx

Recommended Posts

I am working on a mod somewhat like LexManos's YUNoMakeGoodMap. I want it to make the default overworld spawn generation have the same island type thing as in the End, but I want it to spawn like the normal Overworld, where it has dirt, stone, and ores. I have been looking around for a little bit now, and found this class in the source code for the ChunkProviderEnd class:

 

    public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_)
    {
        BlockFalling.fallInstantly = true;

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false));

        int k = p_73153_2_ * 16;
        int l = p_73153_3_ * 16;
        BiomeGenBase biomegenbase = this.endWorld.getBiomeGenForCoords(k + 16, l + 16);
        biomegenbase.decorate(this.endWorld, this.endWorld.rand, k, l);

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, endWorld, endWorld.rand, p_73153_2_, p_73153_3_, false));

        BlockFalling.fallInstantly = false;
    }

I know this is for the spawning of the End island, but I want the code like in the ChunkProviderGenerate#provideChunk function, where it gives you to code of the actual generation. This is also a big deal, because the ender dragon is spawning, and I definitely do not want that. Thank you for your time!

Link to comment
Share on other sites

Its now that easy, the island generation is done by the EndBiomDecorator, so if you replace the generator of the default Bioms with this one it will maybe work. To prevent the EnderDragon from spawning just use some events (LivingJoinWorld)

catch(Exception e)

{

 

}

Yay, Pokémon exception handling, gotta catch 'em all (and then do nothing with 'em).

Link to comment
Share on other sites

Its now that easy, the island generation is done by the EndBiomDecorator, so if you replace the generator of the default Bioms with this one it will maybe work. To prevent the EnderDragon from spawning just use some events (LivingJoinWorld)

What exactly would I need to change, and where? I have tried to extend both my world provider, and chunk provider to the surface ones. This is my new ChunkProviderGenerate#populate override:

    public void populate(IChunkProvider provider, int x, int z){
        int k = x * 16;
        int l = z * 16;
        BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
        biomegenbase.decorate(this.worldObj, this.worldObj.rand, k, l);
        super.populate(provider, x, z);
    }

Link to comment
Share on other sites

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.