Modding 1.4.7: Biome Customization: Mod file

In this tutorail I will show you how to customize your biome a bit. There are 2 places where you can customize your biome. It can be done both in the mod file and the biome file. In this tutorial we will cover changes in the mod file. This is the file I will start with.


package tutorial;

importnet.minecraft.world.biome.BiomeGenBase;
importnet.minecraftforge.common.DimensionManager;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
importcpw.mods.fml.common.event.FMLInitializationEvent;
importcpw.mods.fml.common.network.NetworkMod;
importcpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = “Tutorial_Tutorialmod”, name = “Tutorial”, version = “1.0”)
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
publicclass Tutorial
{
       @SidedProxy(clientSide = “tutorial.ClientProxyTutorial”, serverSide = “tutorial.CommonProxyTutorial”)
       publicstatic CommonProxyTutorial proxy;
      
       publicstaticintdimension = 20;
      
       publicstatic BiomeGenBase tutorialBiome;
      
       @Init
       publicvoid load(FMLInitializationEvent event)
       {
             proxy.registerRenderThings();
            
             tutorialBiome = new BiomeGenTutorial(53);
            
             GameRegistry.addBiome(tutorialBiome);
            
             DimensionManager.registerProviderType(dimension, WorldProviderTutorial.class, false);
             DimensionManager.registerDimension(dimension, dimension);
       }
}

This file is the easiest to change, but you also can’t change that much.
All the code I will show for this file will be about the tutorialBiome = File line. The first thing you should do is add a color for your biome. That is done with this line.


tutorialBiome = newBiomeGenTutorial(53).setColor(2900485);


I’m not exactly sure what the color does for your dimension. I have been looking around the internet and in code etc. to find out exactly what it does, but I can’t seem to find it. However, I expect that it handles the color of grass, leaves, water or a combination of them.
One other thing you should add to your biome is a name. This name is displayed in the F3 screen. You need this code for it.


.setBiomeName(“Tutorial Biome”)


All of the .something code showed from now onwards has to be placed behind the .setColor() part, but before the ;.
There are also several weather things you can set in the mod file. You can enable snow with this line


.setEnableSnow()


You can also disable rain with this.


.setDisableRain()


There are 2 more important parts of code that you might want to add to your mod file. The first one is about temperature and rainfall.


.setTemperatureRainfall(1F, 0.5F)


The first parameter in this line is about the temperature. If you give this a value below or equal to 0.2F the rain will be looking like snow so only use that if you have snow enabled. 0.5F is the standard value.
The second parameter in here is the rainfall. The higher you make this the more often it will rain. If it is 0F it will never rain. The standard rainfall is 0.5F.

The last, but also one of the most important bits of code for the customization is this one.


.setMinMaxHeight(0.2F, 1F)


For this method it should also be pretty obvious what it does. It simply sets the minimal and maximum height for your biome.
The first parameter in here is the lowest value which is 0.1F if you don’t change it.
The second parameter is the heighest value which is 0.3F normally.
You shouldn’t make this below -2.0F or above 2.0F. With the values right now there will be some really tall mountains.
Now the file should look something like this.


package tutorial;

importnet.minecraft.world.biome.BiomeGenBase;
importnet.minecraftforge.common.DimensionManager;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
importcpw.mods.fml.common.event.FMLInitializationEvent;
importcpw.mods.fml.common.network.NetworkMod;
importcpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = “Tutorial_Tutorialmod”, name = “Tutorial”, version = “1.0”)
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
publicclass Tutorial
{
       @SidedProxy(clientSide = “tutorial.ClientProxyTutorial”, serverSide = “tutorial.CommonProxyTutorial”)
       publicstatic CommonProxyTutorial proxy;
      
       publicstaticintdimension = 20;
      
       publicstatic BiomeGenBase tutorialBiome;
      
       @Init
       publicvoid load(FMLInitializationEvent event)
       {
             proxy.registerRenderThings();
            
             tutorialBiome = new BiomeGenTutorial(53).setColor(2900485).setBiomeName(“Tutorial Biome”).setTemperatureRainfall(1F, 0.5F).setMinMaxHeight(0.2F, 1F);
            
             GameRegistry.addBiome(tutorialBiome);
            
             DimensionManager.registerProviderType(dimension, WorldProviderTutorial.class, false);
             DimensionManager.registerDimension(dimension, dimension);
       }
}

In the next tutorial I will show you how to add even more customization to your Biome by adding some lines in the Biome file.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">