Jump to content

Recommended Posts

Posted

Such a simple fix, that fixed it!

 

Now, all I need to do is disallow the standard biomes from spawning in my dimension and it'll be DONE.

 

I tried using this:

 

    public static ArrayList<BiomeGenBase> disallowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river));

 

 

But on a new world, I landed in plains after going through the portal. Is there something else I need?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

Such a simple fix, that fixed it!

 

Now, all I need to do is disallow the standard biomes from spawning in my dimension and it'll be DONE.

 

I tried using this:

 

    public static ArrayList<BiomeGenBase> disallowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river));

 

 

But on a new world, I landed in plains after going through the portal. Is there something else I need?

 

I realized it was set as Plains as the default biome. Changed that to my custom one, and everything is peachy now. I don't know if multiple biomes work, as I don't have other biomes yet. I'll make one shortly and try it out...

For now though, I have one last question. How do I assign a biome decorator? I've made my own one, and I want it to add all the ores etc, I can't figure out where I should reference it and how though. I'd assume somewhere in my biome class? In vanilla biomes, it has "theBiomeDecorator" which is from BiomeGenBase - How would I do that?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

    /**
     * Decorates the world. Calls code that was formerly (pre-1. in ChunkProviderGenerate.populate
     */
    public void decorate(World par1World, Random par2Random, int par3, int par4)
    {
        if (this.currentWorld != null)
        {
            throw new RuntimeException("Already decorating!!");
        }
        else
        {
            this.currentWorld = par1World;
            this.randomGenerator = par2Random;
            this.chunk_X = par3;
            this.chunk_Z = par4;
            this.decorate();
            this.currentWorld = null;
            this.randomGenerator = null;
            
            
        }
    }

 

This is the code that you need to add in your biome.  the decorate function is this.decorate.  you need to call your custom decorator instead

Posted

Adding custom blocks to biomes is a sinch!

 

What you need is a config file. Then using configVariableName.getTerrainBlock(Paramaters...).getInt();

 

that will make sure that the block ID is UNDER 255, because what you set the ID to is not the actual ID when it comes to loading...

 

And also, inside the chunk manager you can set the top/filler block without needing a biome.

 

see here:

https://github.com/haydenf96/Spazzysmod/blob/master/Spazzysmod/spazzysmod_common/Spazzysmod/world/chunk/ChunkManagerMoon.java

 

Thats some chunk manager code for a mod I help make.

 

 

[EDIT]

Also, feel free to look at the code for the dimensions. It is found in the world package which is here:

https://github.com/haydenf96/Spazzysmod/tree/master/Spazzysmod/spazzysmod_common/Spazzysmod/world

 

Look through that and you will find everything you need for a dimension.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Posted

Adding custom blocks to biomes is a sinch!

 

What you need is a config file. Then using configVariableName.getTerrainBlock(Paramaters...).getInt();

 

that will make sure that the block ID is UNDER 255, because what you set the ID to is not the actual ID when it comes to loading...

 

And also, inside the chunk manager you can set the top/filler block without needing a biome.

 

see here:

https://github.com/haydenf96/Spazzysmod/blob/master/Spazzysmod/spazzysmod_common/Spazzysmod/world/chunk/ChunkManagerMoon.java

 

Thats some chunk manager code for a mod I help make.

 

 

[EDIT]

Also, feel free to look at the code for the dimensions. It is found in the world package which is here:

https://github.com/haydenf96/Spazzysmod/tree/master/Spazzysmod/spazzysmod_common/Spazzysmod/world

 

Look through that and you will find everything you need for a dimension.

 

Thanks but I've already got all that ;) I mastered Dimensions about a week ago, just got my biome working nicely in it and all I needed was the decorator. Thanks though :)

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

    /**
     * Decorates the world. Calls code that was formerly (pre-1. in ChunkProviderGenerate.populate
     */
    public void decorate(World par1World, Random par2Random, int par3, int par4)
    {
        if (this.currentWorld != null)
        {
            throw new RuntimeException("Already decorating!!");
        }
        else
        {
            this.currentWorld = par1World;
            this.randomGenerator = par2Random;
            this.chunk_X = par3;
            this.chunk_Z = par4;
            this.decorate();
            this.currentWorld = null;
            this.randomGenerator = null;
            
            
        }
    }

 

This is the code that you need to add in your biome.  the decorate function is this.decorate.  you need to call your custom decorator instead

 

How exactly do I call my custom decorator though? I don't see anywhere that... "asks" for it?

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

I still have this not working properly as my biomes spawn in the overworld and my dimension is still covered with all the possible biomes... And i think thats because of the fact that i use WorldChunkManager(), as it goes in there it has the list of all the biomes in there. I can't seem to figure out how to do this. I do have a biomeDecorator but i'm not sure wether it is working properly as i first wanted to try fix this. Although i think it works.

Posted

    /**
     * Decorates the world. Calls code that was formerly (pre-1. in ChunkProviderGenerate.populate
     */
    public void decorate(World par1World, Random par2Random, int par3, int par4)
    {
        if (this.currentWorld != null)
        {
            throw new RuntimeException("Already decorating!!");
        }
        else
        {
            this.currentWorld = par1World;
            this.randomGenerator = par2Random;
            this.chunk_X = par3;
            this.chunk_Z = par4;
            this.decorate();
            this.currentWorld = null;
            this.randomGenerator = null;
            
            
        }
    }

 

This is the code that you need to add in your biome.  the decorate function is this.decorate.  you need to call your custom decorator instead

 

How exactly do I call my custom decorator though? I don't see anywhere that... "asks" for it?

public YourCustomBiomeDecorator thebiomedecorator;

 

 

YourCustomBiomeDecorator thebiomedecorator = new YourCustomBiomeDecorator()
thebiomedecorator.decorate();

Posted

Custom biomedecorator is being called in the custom BiomeGenBase class and in all the biomes. Now i would really like to know how you guys did what i asked above. Because i almost got this to work i just need to find a way how to make it so that my custom biomes ONLY spawn in my dimension + that i don't get any overworld biomes to spawn there.

Posted

Custom biomedecorator is being called in the custom BiomeGenBase class and in all the biomes. Now i would really like to know how you guys did what i asked above. Because i almost got this to work i just need to find a way how to make it so that my custom biomes ONLY spawn in my dimension + that i don't get any overworld biomes to spawn there.

 

I don't even have a custom BiomeGenBase- I didn't know we needed one?

 

Anyway, to remove your custom biome from overworld, add to your @Init:

            GameRegistry.removeBiome(yourBiomeName);

 

And to remove all vanilla biomes from your dimension:

 

    public static ArrayList<BiomeGenBase> disallowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river));

 

 

Did you manage to get multiple custom biomes in your dimension? If so, can I see your code, I haven't managed to get that yet either, but I put it on hold as the biome decorator is more important to me (I want ores, flowers, long grass etc)

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Posted

Well i am pretty sure that in my case the lists that are defined in my ChunkProvider are read but not used in the generation. Also i somehow do not get a message when entering the world and such while its perfectly the same as in the overworld and such. So uhm jeah here are my classes:

ChunkProviderMarona

 

 

//This one is a shit ton of code so heres a pastebin link :

http://pastebin.com/U57RPPjR

 

 

 

WorldProviderMarona

 

 

package Mod_Ores.BiomeGen.Dimension;

import java.util.Random;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

import Mod_Ores.mod_Ores;

import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.WorldProviderSurface;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;

public class WorldProviderMarona extends WorldProviderSurface
{

//The WorldProvider covers all the basics of the dimension. Look in WorldProviderBase.java and
//WorldProvider.java for all the potential qualities you can assign to your dimension.
public WorldType terrainType;

/**
* States whether the Hell world provider is used(true) or if the normal world provider is used(false)
*/
public boolean isHellWorld = false;

/**
* A boolean that tells if a world does not have a sky. Used in calculating weather and skylight
*/
public boolean hasNoSky = false;


public WorldProviderMarona()
{

}

//The save file will be called DIM65 (DIM + id number).
public int getDimensionID()
{

	return 65;

}

@SideOnly(Side.CLIENT)
public boolean isSkyColored()
{
    return true;
}

@Override
public String getDimensionName()
{
return "Soul Forest";
}

// This somehow doesn't work at all... even when i tried using the "Is instance of" like in the normal getWelcomeMessage(). same for the method getDepartMessage();
@Override
public String getWelcomeMessage()
{
    return "Entering the Soul Forest";
}

/**
* Creates the light to brightness table
*/
@Override
protected void generateLightBrightnessTable()
{
    float f = 0.0F;

    for (int i = 0; i <= 15; ++i)
    {
        float f1 = 1.0F - (float)i / 15.0F;
        this.lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
    }
}

@Override
public String getDepartMessage()
{
    return "Leaving the Soul Forest";
}

//You can use an existing WorldChunkManager, or create your own. You must create your own to
//add multiple unique biomes to a dimension.
public void registerWorldChunkManager()
{	
// I commented this all out, because if i used that method my biome did spawn in my world but beaches rivers and oceans also still did. Also my biome spawned in the entire overworld along with the same.
/*GameRegistry.removeBiome(BiomeGenBase.beach);
GameRegistry.removeBiome(BiomeGenBase.desert);
GameRegistry.removeBiome(BiomeGenBase.desertHills);
GameRegistry.removeBiome(BiomeGenBase.extremeHills);
GameRegistry.removeBiome(BiomeGenBase.extremeHillsEdge);
GameRegistry.removeBiome(BiomeGenBase.forest);
GameRegistry.removeBiome(BiomeGenBase.forestHills);
GameRegistry.removeBiome(BiomeGenBase.frozenOcean);
GameRegistry.removeBiome(BiomeGenBase.frozenRiver);
GameRegistry.removeBiome(BiomeGenBase.hell);
GameRegistry.removeBiome(BiomeGenBase.iceMountains);
GameRegistry.removeBiome(BiomeGenBase.icePlains);
GameRegistry.removeBiome(BiomeGenBase.jungle);
GameRegistry.removeBiome(BiomeGenBase.jungleHills);
GameRegistry.removeBiome(BiomeGenBase.mushroomIsland);
GameRegistry.removeBiome(BiomeGenBase.mushroomIslandShore);
GameRegistry.removeBiome(BiomeGenBase.ocean);
GameRegistry.removeBiome(BiomeGenBase.plains);
GameRegistry.removeBiome(BiomeGenBase.river);
GameRegistry.removeBiome(BiomeGenBase.sky);
GameRegistry.removeBiome(BiomeGenBase.swampland);
GameRegistry.removeBiome(BiomeGenBase.taiga);
GameRegistry.removeBiome(BiomeGenBase.taigaHills);
GameRegistry.addBiome(mod_Ores.SoulForest);
GameRegistry.addBiome(mod_Ores.FrostCaves);*/


// note this very bit over here i am sure about this over here that this goes to the normal lists and get all the biomes from there.
this.worldChunkMgr = new WorldChunkManager(worldObj); 
this.dimensionId = mod_Ores.DimensionSoulForest;
}

//This is where you define your terrain generator.
@Override
public IChunkProvider createChunkGenerator()
{

return new ChunkProviderMarona(worldObj, worldObj.getSeed(), false);

}

//Note that, if you respawn in the dimension, you will end up at the coordinates 	of your
//overworld spawn point, not at the location of your first entrance to the dimension or
//something like that. Note also that beds don't work if yo	u cannot respawn in the dimension.
@Override
public boolean canRespawnHere()
{

return true;

}

}

 

 

 

mod_Ores, its about 2500 lines of code so i snipped out about 99%

@Mod(modid="myOresMod", name="Soul Forest Mod", version="1.4")
@NetworkMod(clientSideRequired = true, serverSideRequired = false, clientPacketHandlerSpec =
@SidedPacketHandler(channels = {"mod_Ores" }, packetHandler = ClientPacketHandler.class),
serverPacketHandlerSpec =
@SidedPacketHandler(channels = {"mod_Ores" }, packetHandler = ServerPacketHandler.class))
public class mod_Ores
{
@Instance("myOresMod") // instance
    public static mod_Ores instance;

public static BiomeGenBase SoulForest;
	public static BiomeGenBase FrostCaves;

// i will just skip the @PreInit

@Init
public void load(FMLInitializationEvent ev)
{				
                SoulForest = (new BiomeGenSoulForest(23).setBiomeName("SoulForest").setTemperatureRainfall(0.3F, 0.8F).setMinMaxHeight(0.0F, 0.9F)); //Custom Biome
	FrostCaves = (new BiomeGenFrostCaves(24).setBiomeName("FrostCaves").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.0F, 0.9F)); //Custom Biome
	GameRegistry.addBiome(SoulForest);
	GameRegistry.addBiome(FrostCaves);
	GameRegistry.removeBiome(SoulForest);
	GameRegistry.removeBiome(FrostCaves);
// i know i add them and remove em again, as you sayd i should add removeBiome(), i think i could just leave the 4 rows out completel but i'm not sure if that works or something. Do i need to GameRegistry.addBiome somewhere else though??
}

 

And for you i also have my biomeGenBase and biomeDecorator

 

TheBiomeDeco

 

 

package Mod_Ores.BiomeGen;

import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM;
import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS;
import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE;

import java.util.Random;

import Mod_Ores.mod_Ores;
import Mod_Ores.BiomeGen.WorldGen.WorldGenBaneberryVines;
import Mod_Ores.BiomeGen.WorldGen.WorldGenBlackberryVines;
import Mod_Ores.BiomeGen.WorldGen.WorldGenBlueberryVines;
import Mod_Ores.BiomeGen.WorldGen.WorldGenCantaloupe;
import Mod_Ores.BiomeGen.WorldGen.WorldGenCranberryVines;
import Mod_Ores.BiomeGen.WorldGen.WorldGenGrapeTree;
import Mod_Ores.BiomeGen.WorldGen.WorldGenRaspberryVines;
import Mod_Ores.BiomeGen.WorldGen.WorldGenRazzberryVines;
import Mod_Ores.BiomeGen.WorldGen.WorldGenStrawberryVines;

import net.minecraft.block.Block;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenBigMushroom;
import net.minecraft.world.gen.feature.WorldGenCactus;
import net.minecraft.world.gen.feature.WorldGenClay;
import net.minecraft.world.gen.feature.WorldGenDeadBush;
import net.minecraft.world.gen.feature.WorldGenFlowers;
import net.minecraft.world.gen.feature.WorldGenLiquids;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenPumpkin;
import net.minecraft.world.gen.feature.WorldGenReed;
import net.minecraft.world.gen.feature.WorldGenSand;
import net.minecraft.world.gen.feature.WorldGenWaterlily;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.OreGenEvent;
import net.minecraftforge.event.terraingen.TerrainGen;

public class TheBiomeDeco extends BiomeDecorator
{	
protected int baneberryvineperchunk;
protected WorldGenerator baneberryVineGen;

protected int blackberryvineperchunk;
protected WorldGenerator blackberryVineGen;

protected int blueberryvineperchunk;
protected WorldGenerator blueberryVineGen;

protected int cranberryvineperchunk;
protected WorldGenerator cranberryVineGen;

protected int raspberryvineperchunk;
protected WorldGenerator raspberryVineGen;

protected int razzberryvineperchunk;
protected WorldGenerator razzberryVineGen;

protected int strawberryvineperchunk;
protected WorldGenerator strawberryVineGen;

protected int grapetreeperchunk;
protected WorldGenerator grapeTreeGen;

protected int cantaloupeperchunk;
protected WorldGenerator cantaloupeGen;

    public TheBiomeDeco(BiomeGenBase par1biomegenbase)
    {
    	super(par1biomegenbase);
	//this.biome = par1biomegenbase;
        this.baneberryVineGen = new WorldGenBaneberryVines();
        this.baneberryvineperchunk = 0;
        this.blackberryVineGen = new WorldGenBlackberryVines();
        this.blackberryvineperchunk = 0;
        this.blueberryVineGen = new WorldGenBlueberryVines();
        this.blueberryvineperchunk = 0;
        this.cranberryVineGen = new WorldGenCranberryVines();
        this.cranberryvineperchunk = 0;
        this.raspberryVineGen = new WorldGenRaspberryVines();
        this.raspberryvineperchunk = 0;
        this.razzberryVineGen = new WorldGenRazzberryVines();
        this.razzberryvineperchunk = 0;
        this.strawberryVineGen = new WorldGenStrawberryVines();
        this.strawberryvineperchunk = 0;
        this.grapeTreeGen = new WorldGenGrapeTree(true);
        this.grapetreeperchunk = 0;
        this.cantaloupeGen = new WorldGenCantaloupe(mod_Ores.plantCantaloupe.blockID);
        this.cantaloupeperchunk = 0;
    }

@Override
protected void decorate() 
{
	super.decorate();

	for (int g1 = 0; g1 < grapetreeperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        grapeTreeGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        //vines
        for (int g1 = 0; g1 < baneberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        baneberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < blackberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        blackberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < blueberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        blueberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < cranberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        cranberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < raspberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        raspberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < razzberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        razzberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < strawberryvineperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = chunk_Z + randomGenerator.nextInt(16) + 8;
        strawberryVineGen.generate(currentWorld, randomGenerator, g2, currentWorld.getHeightValue(g2, g3), g3);
        }
        for (int g1 = 0; g1 < cantaloupeperchunk; g1++)
        {
        int g2 = chunk_X + randomGenerator.nextInt(16) + 8;
        int g3 = randomGenerator.nextInt(128);
        int g4 = chunk_Z + randomGenerator.nextInt(16) + 8;
        cantaloupeGen.generate(currentWorld, randomGenerator, g2, g3, g4);
        }		
}   
}

 

 

 

BiomeGenBaseMarona // i am not sure what and how to use it yet because if i start changing everything to BiomeGenBaseMarona it makes me have to change a hell lot more... i haven't figured out how to do anything that way, like you end up making a custom WorldChunkManager, BiomeCacheBlock, GenLayer etc etc.  Thats also why i have everything outcomented in my editor.

 

 

package Mod_Ores.BiomeGen;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenBigTree;
import net.minecraft.world.gen.feature.WorldGenForest;
import net.minecraft.world.gen.feature.WorldGenSwamp;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.BiomeEvent;
import Mod_Ores.Mobs.Entity.EntityBlueSlime;
import Mod_Ores.Mobs.Entity.EntityEnt;
import Mod_Ores.Mobs.Entity.EntityIceFairy;
import Mod_Ores.Mobs.Entity.EntitySnowCreeper;
import Mod_Ores.BiomeGen.TheBiomeDeco;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BiomeGenBaseMarona extends BiomeGenBase
{
 	public static final BiomeGenBase[] biomeList = new BiomeGenBase[256];

 	//public static final BiomeGenBase SoulForest = (new BiomeGenSoulForest(0).setBiomeName("SoulForest").setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.0F, 0.9F)); //Custom Biome
 	//public static final BiomeGenBase FrostCaves = (new BiomeGenFrostCaves(1).setBiomeName("FrostCaves").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.0F, 0.9F)); //Custom Biome

	public String biomeName;
    public int color;

    public byte topBlock;

public byte fillerBlock;
    public int field_76754_C;

public float minHeight;

public float maxHeight;

public float temperature;

public float rainfall;

public int waterColorMultiplier;

public TheBiomeDeco theBiomeDecorator;

protected List spawnableMonsterList;

protected List spawnableCreatureList;

protected List spawnableWaterCreatureList;
    protected List spawnableCaveCreatureList;

private boolean enableSnow;

private boolean enableRain;

public final int biomeID;

	public BiomeGenBaseMarona(int par1) 
	{
		super(par1);
		this.topBlock = (byte)Block.grass.blockID;
        this.fillerBlock = (byte)Block.dirt.blockID;
        this.field_76754_C = 5169201;
        this.minHeight = 0.1F;
        this.maxHeight = 0.3F;
        this.temperature = 0.5F;
        this.rainfall = 0.5F;
        this.waterColorMultiplier = 16777215;
        this.spawnableMonsterList = new ArrayList();
        this.spawnableCreatureList = new ArrayList();
        this.spawnableWaterCreatureList = new ArrayList();
        this.spawnableCaveCreatureList = new ArrayList();
        this.enableRain = true;
        this.worldGeneratorTrees = new WorldGenTrees(false);
        this.worldGeneratorBigTree = new WorldGenBigTree(false);
        this.worldGeneratorForest = new WorldGenForest(false);
        this.worldGeneratorSwamp = new WorldGenSwamp();
        this.biomeID = par1;
        biomeList[par1] = this;
        this.theBiomeDecorator = this.createBiomeDecorator();
        this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4));
        this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 10, 4, 4));
        this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4));
        this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 8, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityBlueSlime.class, 7, 5, 10));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySnowCreeper.class, 6, 2, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityEnt.class, 8, 3, 5));
        this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityIceFairy.class, 10, 10, 10));
        this.spawnableWaterCreatureList.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4));
        this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityBat.class, 10, 8, );
	}

public TheBiomeDeco createBiomeDecorator()
    {   
        return getModdedBiomeDecorator(new TheBiomeDeco(this));
    }

public BiomeGenBase setTemperatureRainfall(float par1, float par2)
    {
        if (par1 > 0.1F && par1 < 0.2F)
        {
            throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
        }
        else
        {
            this.temperature = par1;
            this.rainfall = par2;
            return this;
        }
    }

public BiomeGenBase setMinMaxHeight(float par1, float par2)
    {
        this.minHeight = par1;
        this.maxHeight = par2;
        return this;
    }

public BiomeGenBase setDisableRain()
    {
        this.enableRain = false;
        return this;
    }

public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
    {
        return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees);
    }

public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
    {
        return new WorldGenTallGrass(Block.tallGrass.blockID, 1);
    }

public BiomeGenBase setEnableSnow()
    {
        this.enableSnow = true;
        return this;
    }

    public BiomeGenBase setBiomeName(String par1Str)
    {
        this.biomeName = par1Str;
        return this;
    }

    public BiomeGenBase func_76733_a(int par1)
    {
        this.field_76754_C = par1;
        return this;
    }

    public BiomeGenBase setColor(int par1)
    {
        this.color = par1;
        return this;
    }

    @SideOnly(Side.CLIENT)

public int getSkyColorByTemp(float par1)
    {
        par1 /= 3.0F;

        if (par1 < -1.0F)
        {
            par1 = -1.0F;
        }

        if (par1 > 1.0F)
        {
            par1 = 1.0F;
        }

        return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
    }

public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
    {
        return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null)));
    }

public boolean getEnableSnow()
    {
        return this.enableSnow;
    }

public boolean canSpawnLightningBolt()
    {
        return this.enableSnow ? false : this.enableRain;
    }

public boolean isHighHumidity()
    {
        return this.rainfall > 0.85F;
    }

public float getSpawningChance()
    {
        return 0.1F;
    }

    public void decorate(World par1World, Random par2Random, int par3, int par4)
    {
        this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4);
    }

    @SideOnly(Side.CLIENT)

public int getBiomeGrassColor()
    {
        double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
        double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
        return getModdedBiomeGrassColor(ColorizerGrass.getGrassColor(d0, d1));
    }

    @SideOnly(Side.CLIENT)

public int getBiomeFoliageColor()
    {
        double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
        double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
        return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1));
    }

    public TheBiomeDeco getModdedBiomeDecorator(TheBiomeDeco original)
    {
    	BiomeEventMarona.CreateDecorator event = new BiomeEventMarona.CreateDecorator(this, original);
        MinecraftForge.TERRAIN_GEN_BUS.post(event);
        return event.newTheBiomeDeco;
    }

    @SideOnly(Side.CLIENT)
    public int getWaterColorMultiplier()
    {
    	BiomeEventMarona.GetWaterColor event = new BiomeEventMarona.GetWaterColor(this, waterColorMultiplier);
        MinecraftForge.EVENT_BUS.post(event);
        return event.newColor;
    }
    
    @SideOnly(Side.CLIENT)
    public int getModdedBiomeGrassColor(int original)
    {
    	BiomeEventMarona.GetGrassColor event = new BiomeEventMarona.GetGrassColor(this, original);
        MinecraftForge.EVENT_BUS.post(event);
        return event.newColor;
    }
    

    @SideOnly(Side.CLIENT)
    public int getModdedBiomeFoliageColor(int original)
    {
    	BiomeEventMarona.GetFoliageColor event = new BiomeEventMarona.GetFoliageColor(this, original);
        MinecraftForge.EVENT_BUS.post(event);
        return event.newColor;
    }
}

 

 

Posted

Sorry, I still don't quite follow. Which lines am I putting in which classes? Any chance you can show me an example? (psuedocode is fine)

 

Im not home at the moment to go into more detail, but you can look at BiomeGenBase at all the code related to the biome decorator, copy it into your biome and change it to your biome decorator.  I personally dont use a biome decorator, I put all the decorating in the biome file itself.  Ill post some code later when I get time if you havent figured it out by then.

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.