Dimension
On hold until problems are resolved.
This tutorial has been long awaited. It will utilise Forge and it alone. If you are following this tutorial it is expected that you have already set up your Forge workspace and have the main registry class of your mod set up. When I say "the main registry class", I am referring to the class with the @Mod annotation and the three methods with the @Init, @PreInit and @PostInit annotations.
At first, it will be a basic tutorial on how to get the dimension up and running. After that you can customise it however you like. I plan to have customisation tutorials up soon but I would prefer just to get this bit done well first.Before we actually get to making the dimension, I'll give a bit of an explanation as to how they actually work.
Dimensions use something called a WorldProvider. The WorldProvider registers almost everything to do with the dimension. Functions the WorldProvider has include registering the chunk manager and provider for the world(more about this below), the angle the sky is rotated at and setting the light levels, biomes and fog levels; just to name a few.
The biome/s of the world is/are set in the WorldChunkManager. You could have one biome, or many. It is all up to you when you get to customising it. The chunk manager is registered in the WorldProvider class.
The terrain itself is set in the ChunkProvider for the world. The ChunkProvider allows possibly the most customisation out of every other class that you will make. It is registered in the WorldProvider class aswell. In the chunk provider you can change terrain levels, water/lava pools, villages, strongholds, dungeons, etc. and several other variables that are fun to mess around with.
The first thing you'll need to do is register a provider for your dimension.
DimensionManager.registerProviderType(25,WorldProviderNameHere.class, true);
The registerProviderType method accepts three arguments: An int, a class and a boolean. The int is the id you want to assign to the world provider. The class is the actual class of the world provider. The boolean is whether or not to keep the world loaded. That is, keep the world prebuffered so it loads quicker(needs citation). For example, the Overworld and Nether have this boolean set to true but the End has it set to false. This is because the Overworld and Nether are the main two dimensions of the game.
Next you will need to register the dimension itself and assign the world provider.
DimensionManager.registerDimension(DimensionManager.getNextFreeDimId(), 25);
The registerDimension method accepts two ints for its arguments. The first is the id of the dimension. You are best of calling the getNextFreeDimId method here so that there are less incompatibilities. The second int is the providerType id you assigned to the world provider above. In our example we used 25.
This section is under work. I will try not to let it die like the gui tutorial did. By the time this tutorial is fully done, it will probably be my most comprehensive tutorial by far.
Tutorials I Recommend
This is a list of tutorials I recommend. These tutorials are not made by me, nor will I make tutorials on things listed below. I can't guarantee that these tutorials will continue to be updated and work in the future.- Adding Sounds - By lockNload147 (Vanilla(All MC Versions), Forge 1.5)
- Damage Item After Use In Recipe - By dmillerw (All MC Versions)
253