Jump to content

World Gen Help


RoyalReject

Recommended Posts

Do you mean custom dimensions?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

I haven't touched world gen at all yet (though I plan to eventually for 2 of my mod ideas) but one way is to see how others are doing it by looking at existing mods with released source code.  Usually if I take this approach, I search curseforge for a mod that seems similar to what I want to try, then go to the mod page and see if it has the "source" tab.

 

Here's curseforge's mods with the "worldgen" tag: https://minecraft.curseforge.com/mc-mods/world-gen

You can also select a more specific worldgen tag on the left on that page, such as "dimensions", "biomes" or "structures".

 

And here is one that adds a dimension, and has source available (fairly recent source too, which is good).  Disclaimer: I have no experience with the mod itself, I just found it in a quick search is all:

https://github.com/Darkhax-Minecraft/Hunting-Dimension

 

Beyond that I'd say maybe start looking through some of these classes:

DimensionType

WorldProvider (and its subclasses: WorldProviderSurface, WorldProviderHell, and WorldProviderEnd)

 

I'm sure there are some other good classes to look at, but again I haven't actually done any world gen...yet.

Link to comment
Share on other sites

You should also check our Jabelar’s tutorials, their very comprehensive

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

The basics aren't that hard.  The world type class itself looks like this:

 

package your.mod.generation;

import javax.annotation.Nonnull;

import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeProvider;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.ChunkGeneratorOverworld;
import net.minecraft.world.gen.IChunkGenerator;

public class YourWorldType extends WorldType {
    private static BiomeProvider biomeProvider;
    public static IChunkProvider chunkProvider;

	public YourWorldType() {
		super("name of your world type");		
	}

    public IChunkGenerator getChunkGenerator(World world, String generatorOptions) { 
        return new ChunkGeneratorOverworld(world, world.getSeed(), 
        		world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions);
    }

    @Override @Nonnull
    public BiomeProvider getBiomeProvider(@Nonnull World world) { 
        //return a copy of your biome provider (could even be from vanilla)
    }


}

 

 

Your main mod class should have an instance of the type, and preinit should have a line that initializes it.

 

What you actually do with it, from there (biomes, biome / chunk providers, etc.) is up to you, and could be simple or very complicated.

 

This is to create a new type and add it as an option to the start menus for starting a new world (the name should be unlocalized, keyed to lang files).

 

If you want to create a dimension with its own world type I would recommend the "Up To Date Minecraft Modding" Youtube series by Harry Talks.

Edited by TheCatMorris
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.