Jump to content

Recommended Posts

Posted

Hello All, I'm building a huge RPG mod.(and finally updated it to 1.10.2)

but i'm currently stuck at the part where i need to create NetherBiomes.

 

Overworld biomes are relatively easy to add. but i have no idea how to begin with the netherbiomes.

 

I want some parts of the nether(biomes) to generate my custom block instead of netherrack. with some flowers and  trees.

 

can someone give me some intructions on what classes i need to create to create biomes in the nether?

 

 

my Mod: Extended RPG [W.I.P]

Posted

This topic has come up within the last year, so a Google search should show you the earlier discussion(s) to get you started.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

Hello All, I'm building a huge RPG mod.(and finally updated it to 1.10.2) but i'm currently stuck at the part where i need to create NetherBiomes.

 

Overworld biomes are relatively easy to add. but i have no idea how to begin with the netherbiomes.

 

I want some parts of the nether(biomes) to generate my custom block instead of netherrack. with some flowers and  trees.

 

can someone give me some intructions on what classes i need to create to create biomes in the nether?

 

I am working on a Nether Biome mod. Take a look: https://github.com/LogicTechCorp/NetherEx. Please do not copy-paste.

Posted

ok, got it to work. the only problem i have with this. is that the biomes are way to small. sometimes its like 1 or 2 chunks big per biome. where can i change that so they got the size of a overworld Biome?

 

is this bug because of (if you travel through the nether like 100 meters and you build a portal again to go through the overworld. and al the meters you traveled wil be multiplied by 7.( so you have moved 700 meters away).) and the biome uses this type of calculation too. or is there something wrong with my code?

 

i unregistered and registered the nether so I can add my own worldProvider. something LogicTechCorp also did in his code. and I have copied(and changed a little bit) the vanilla GenLayer/Providers Stuff.

everything is working( except a little bit lag in the nether and the XXS biomes

my Mod: Extended RPG [W.I.P]

Posted

ok, got it to work. the only problem i have with this. is that the biomes are way to small. sometimes its like 1 or 2 chunks big per biome. where can i change that so they got the size of a overworld Biome?

 

is this bug because of (if you travel through the nether like 100 meters and you build a portal again to go through the overworld. and al the meters you traveled wil be multiplied by 7.( so you have moved 700 meters away).) and the biome uses this type of calculation too. or is there something wrong with my code?

 

i unregistered and registered the nether so I can add my own worldProvider. something LogicTechCorp also did in his code. and I have copied(and changed a little bit) the vanilla GenLayer/Providers Stuff.

everything is working( except a little bit lag in the nether and the XXS biomes

 

Post your current ChunkProvider code. I had a similar issue with really small biomes, in my project a few weeks ago that I managed to fix. Need to see all of your biomesForGeneration setters, to see if you are facing the same issue that I had.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted

Solved. thanks. i used a wrong setter for BiomeForGeneration. :P

 

only thing what i need to do is to generate trees and tall grass in the nether.

 

my Mod: Extended RPG [W.I.P]

Posted

Solved. thanks. i used a wrong setter for BiomeForGeneration. :P

 

only thing what i need to do is to generate trees and tall grass in the nether.

 

 

Well, as I mentioned in a previous post just today, I have an IWorldGenerator that places various trees for me, in a custom WorldType, WorldProvider, ChunkProvider etc. The actual dimension is heavily similar to the Nether, literally just stone instead of netherrack and so forth. You can find the link to said IWorldGenerator, in said thread.

 

As for the grass: How much of the grass do you want to spawn? If you want it to spawn quite a bit, but not take too much resources, I'd recommend you bake it directly into your chunkprovider.

In my own chunkprovider, I have a pseudo-dirt block that changes itself to grass|dirt|snow|sand|sandstone depending on biome and what is above it; this lets me easily add in 5 different blocks, at the world-generation cost of almost nothing.

ChunkProviders work directly with blockstates, whereas most custom worldgen 1) get block, 2) check block, 3) either stop or change block. This is heavy on performance.

You can see my voodoo-block here.

Take note on the snow-placing especially, as it checks if the blockpos above is suitable for another type of block, like you want for your grass.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Posted

I already created A BiomeDecorater where I Spawned Trees and tall grass in the overworld

and this worked for 1.8.9 but I don't know if this still works in 1.10.2 because i havend found my own Biome yet.

 

I placed coins on the W button to let me flew 50 Km with a print that says ("Biome is here at" + pos.getX() + "x/ " + pos.getZ() + "z") when it is generated and i know this works because i tested it with the netherBiomes if it would work.

 

take a look at my BiomeDecorator here

 

public class MarkDecorator extends BiomeDecorator {

public MarkDecorator(Biome biome) {

    }
    
    public void decorate(World world, Random random, Biome base, BlockPos pos)
    {
    if (this.decorating)
    {
	    throw new RuntimeException("Already decorating!!");
    }
    else
    { 
    	this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(world.getWorldInfo().getGeneratorOptions()).build();
	    this.chunkPos = pos;
	    this.genDecorations(base, world, random);
	    this.decorating = false;
            
    }
    }

    protected void genDecorations(Biome base, World world, Random random)
    {
    	System.out.println("Decorating one of the biomes at : " + this.chunkPos.getX() + " / " + this.chunkPos.getZ());
    	
    	net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(world, random, chunkPos));
    if(base == MarkBiome.Biome_1_Enriched || base == MarkBiome.Biome_2_NetherDesert || base == MarkBiome.Biome_2_BlueNetherDesert)
    { 
        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS))
            for (int i3 = 0; i3 < this.grassPerChunk; ++i3)
            {
            	int j7 = random.nextInt(16) + 8;
                int i11 = random.nextInt(16) + 8;
                int k14 = world.getHeight(this.chunkPos.add(j7, 0, i11)).getY() * 2;

                if (k14 > 0)
                {
                
                	int l17 = random.nextInt(k14);
                	if(base == MarkBiome.Biome_1_Enriched){
                    ((BiomeGenEnriched)base).getRandomWorldGenForGrass(random).generate(world, random, chunkPos.add(j7, l17, i11));
                	}
                	else if(base == MarkBiome.Biome_2_NetherDesert){
                    ((BiomeNetherD)base).getRandomWorldGenForGrass(random).generate(world, random, chunkPos.add(j7, l17, i11));
                    }
                	else if(base == MarkBiome.Biome_2_BlueNetherDesert){
                	((BiomeNetherBD)base).getRandomWorldGenForGrass(random).generate(world, random, chunkPos.add(j7, l17, i11));
                	}
                }
            }
        int k1 = this.treesPerChunk;

        if (random.nextInt(10) == 0)
        {
            ++k1;
        }

        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)){
        for (int j2 = 0; j2 < k1; ++j2)
        {
            int k6 = random.nextInt(16) + 8;
            int l = random.nextInt(16) + 8;
            WorldGenAbstractTree worldgenabstracttree = base.genBigTreeChance(random);
            worldgenabstracttree.setDecorationDefaults();
            BlockPos blockpos = world.getHeight(chunkPos.add(k6, 0, l));

            if (worldgenabstracttree.generate(world, random, blockpos))
            {
                worldgenabstracttree.generateSaplings(world, random, blockpos);
            }
        }
    }}
    
    if(base == MarkBiome.Biome_1_Enriched)
    {
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)){
        	
            for (int j3 = 0; j3 < 1; ++j3)
            {
                int k7 = random.nextInt(16) + 8;
                int j11 = random.nextInt(16) + 8;
                int l14 = world.getHeight(chunkPos.add(k7, 0, j11)).getY() * 2;

                if (l14 > 0)
                {
                	
                    int i18 = random.nextInt(l14);
                    (new WorldGenMarkCrystalBush()).generate(world, random, chunkPos.add(k7, i18, j11));
                }
            }
    }
        
    }
    }
}

 

and my BiomeGenBase Class

public class MarkBiome extends Biome {

public MarkBiome(BiomeProperties properties) {
	super(properties);
	this.theBiomeDecorator = new MarkDecorator(this);
}
public static void init(){
	initBiome();
	regBiome();

}
private static Set<BiomeManager.BiomeEntry> NetherEntries = Sets.newHashSet();
public static Biome Biome_1_Enriched;
public static Biome Biome_2_Nether;
public static Biome Biome_2_NetherDesert;
public static Biome Biome_2_BlueNether;
public static Biome Biome_2_BlueNetherDesert;

;



public static void initBiome(){

	DimensionManager.unregisterDimension(-1);
	DimensionType nether = DimensionType.register("Nether", "_nether", -1, NetherWorldProvider.class, false);
    DimensionManager.registerDimension(-1, nether);

	Biome_1_Enriched = new BiomeGenEnriched((new Biome.BiomeProperties("Enriched")).setBaseBiome("Enriched").setTemperature(1.2F).setRainfall(0.9F).setWaterColor(2653061));
	Biome_2_Nether = new BiomeNether((new Biome.BiomeProperties("Nether")).setRainDisabled());
	Biome_2_NetherDesert = new BiomeNetherD((new Biome.BiomeProperties("NetherDesert")).setRainDisabled());
	Biome_2_BlueNether = new BiomeCryst((new Biome.BiomeProperties("Cryst")).setRainDisabled());
	Biome_2_BlueNetherDesert = new BiomeCrystD((new Biome.BiomeProperties("CrystDesert")).setRainDisabled());



}
public static void regBiome(){
	BiomeDictionary.registerBiomeType(Biome_1_Enriched, Type.MAGICAL);
	BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(Biome_1_Enriched, 10));
	BiomeManager.addSpawnBiome(Biome_1_Enriched);

	AddNetherBiome(Biome_2_Nether, 45, 180, "Nether");
	AddNetherBiome(Biome_2_NetherDesert, 25, 181, "NetherDesert");
	AddNetherBiome(Biome_2_BlueNether, 17, 182, "BlueNether");
	AddNetherBiome(Biome_2_BlueNetherDesert, 13, 183, "BlueNetherDesert");
}

	public static void AddNetherBiome(Biome biome, int Weight, int ID, String Name)
	{
		Biome.registerBiome(ID, Name, biome);
		NetherEntries.add(new BiomeEntry(biome, Weight));
	}

	public static ImmutableList<BiomeManager.BiomeEntry> getBiomeEntries()
    {
        return ImmutableList.copyOf(NetherEntries);
    }

}	

 

the NetherBiomes were Registered with Biome.registerBiome because I needed a int ID to generate the biomes in the nether.

my Mod: Extended RPG [W.I.P]

Posted

Bump...

 

I even cant find the surface biomes... flew 50km again without succes, have seen every minecraft biome. and 80% of the biomes i Saw was Taiga btw.

 

What's wrong with my code (previous post for where I register the biomes, and my mainclass:

 

@EventHandler
public void init(FMLInitializationEvent Event){

...
        ClientProxy.registerRenderers();
        MarkBiome.init();

}

what is wrong with it am I so unlucky or...?

 

and got another problem, with My custom mob not rendering correctly(it's a white box now)

it worked in 1.8.9

 

Clientproxy:

  public static void registerRenderers(){
    	RenderingRegistry.registerEntityRenderingHandler(EntitySalaCommon.class, RenderSalaCommon::new);
    	RenderingRegistry.registerEntityRenderingHandler(EntitySalaDesert.class, RenderSalaDesert::new);
}

 

and here is the render class:

@SideOnly(Side.CLIENT)
public class RenderSalaCommon extends RenderLiving {

public static final ResourceLocation Texture_SalaCommon = new ResourceLocation(ReferenceStrings.MODID + ":textures/entity/salacommon.png");

public RenderSalaCommon(RenderManager rendermanagerIn) {
	super(rendermanagerIn, new ModelSalamander(), 0.5f);

}

protected ResourceLocation getEntityTexture1(EntitySalaCommon entity) {

	return Texture_SalaCommon;
}

@Override
protected ResourceLocation getEntityTexture(Entity entity) {

	return this.getEntityTexture1((EntitySalaCommon)entity);
}

}

 

this code fully worked in 1.8.9 until I updated the mod to 1.10.2

 

my Mod: Extended RPG [W.I.P]

  • 2 weeks later...
Posted

okay, found an alternative solution to generate my grass and trees in the nether

simply just add some code to my worldGenerator Class

 

checking what biome it is with:

 

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator,
		IChunkProvider chunkProvider) {
	switch (world.provider.getDimension()) {
case 0: //the surface dimension
...
break;
case -1: // the nether dimension
...
if(world.getBiomeForCoordsBody(new BlockPos(chunkX * 16, 0, chunkZ * 16)) == the biome i want) 
{
//then here the "this.RunGenerator(parameters);"
}

my Mod: Extended RPG [W.I.P]

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.