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;

import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.DimensionManager;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "Tutorial_Tutorialmod", name = "Tutorial", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Tutorial
{
       @SidedProxy(clientSide = "tutorial.ClientProxyTutorial", serverSide = "tutorial.CommonProxyTutorial")
       public static CommonProxyTutorial proxy;
      
       public static int dimension = 20;
      
       public static BiomeGenBase tutorialBiome;
      
       @Init
       public void 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 = new BiomeGenTutorial(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;

import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.DimensionManager;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "Tutorial_Tutorialmod", name = "Tutorial", version = "1.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Tutorial
{
       @SidedProxy(clientSide = "tutorial.ClientProxyTutorial", serverSide = "tutorial.CommonProxyTutorial")
       public static CommonProxyTutorial proxy;
      
       public static int dimension = 20;
      
       public static BiomeGenBase tutorialBiome;
      
       @Init
       public void 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.

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

3 opmerkingen:

  1. When is that next tutorial for biomes then, because I am dying to see it.

    BeantwoordenVerwijderen
  2. for the first half of the febuary 10th section, did you create a new class? And if so how??

    BeantwoordenVerwijderen
  3. ROBLOX is powered by an ever growing membership base of over 300,000 creators who produce an infinite variety of highly immersive experiences.

    These experiences range from 3D multiplayer games and contests, to interactive adventures where players can take on new identities to discover what it would be like to be a dinosaur, a miner working a mine or an astronaut out in space.

    BeantwoordenVerwijderen