Modding 1.4.7: Adding a custom biome to your dimension

In this tutorial I will show you how to add your custom biome to a custom dimension. To understand this tutorial you will need to have read the Biome tutorials and Dimension tutorials. The file where you need to add the biome is the WorldProvider class. This is the file I will start with.

package tutorial;

import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;

public class WorldProviderTutorial extends WorldProvider
{
       public void registerWorldChunkManager()
       {
             this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.beach, 0.8F, 0.1F);
             this.dimensionId = Tutorial.dimension;
       }
      
       public String getDimensionName()
       {
             return "Tutorial";
       }
      
       public boolean canRespawnHere()
       {
             return true;
       }
      
       public String getSaveFolder()
    {
        return "Custom Dimension Tutorial Folder";
    }
      
       public double getMovementFactor()
    {
             return 25.0;
    }
      
       @Override
       public IChunkProvider createChunkGenerator()
       {
             return new ChunkProviderTutorial(worldObj, worldObj.getSeed(), true);
       }
}

Adding a custom biome to your dimension is really easy. Simply replace the BiomeGenBase.beach into modfile.biomename.
The registerWorldChunkManager should look something like this after you have added your custom biome.

public void registerWorldChunkManager()
       {
             this.worldChunkMgr = new WorldChunkManagerHell(Tutorial.tutorialBiome, 0.8F, 0.1F);
             this.dimensionId = Tutorial.dimension;
       }

That's everything you need for this tutorial.

When you are done you should go back to the tutorials list here.

2 opmerkingen: