Jump to content

Recommended Posts

Posted

I found out how to make the world generate only 1 specific biome, but how would I make the world generate a specific biome at a specific chunk coordinate? Overriding getBiomeGenAt does nothing, I think it's only for seeing what biome is at that chunk coordinate.

 

My Chunk Manager Class:

package ttm.world;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

import net.minecraft.world.ChunkPosition;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;

public class WorldChunkManagerTtM extends WorldChunkManager {
@Override
public BiomeGenBase getBiomeGenAt(int x, int y) {
	return BiomeGenBase.desertHills;
}

@Override
public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] biomes, int par2, int par3, int par4, int par5) {
	if(biomes == null || biomes.length < par4 * par5) {
		biomes = new BiomeGenBase[par4 * par5];
	}

	Arrays.fill(biomes, 0, par4 * par5, BiomeGenBase.desertHills);
	return biomes;
}

@Override
public float[] getRainfall(float[] rain, int par2, int par3, int par4, int par5) {
	if(rain == null || rain.length < par4 * par5) {
		rain = new float[par4 * par5];
	}

	Arrays.fill(rain, 0, par4 * par5, BiomeGenBase.desertHills.rainfall);
	return rain;
}

@Override
public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] biomes, int par2, int par3, int par4, int par5) {
	if(biomes == null || biomes.length < par4 * par5) {
		biomes = new BiomeGenBase[par4 * par5];
	}

	Arrays.fill(biomes, 0, par4 * par5, BiomeGenBase.desertHills);
	return biomes;
}

@Override
public ChunkPosition findBiomePosition(int x, int y, int p_150795_3_, List p_150795_4_, Random p_150795_5_) {
	return p_150795_4_.contains(BiomeGenBase.desertHills) ? new ChunkPosition(x - p_150795_3_ + p_150795_5_.nextInt(p_150795_3_ * 2 + 1), 0, y - p_150795_3_ + p_150795_5_.nextInt(p_150795_3_ * 2 + 1)) : null;
}

@Override
public boolean areBiomesViable(int par1, int par2, int par3, List par4List) {
	return par4List.contains(BiomeGenBase.desertHills);
}
}

Kain

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.