Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Biome specific ore generation not working.


Kander16
 Share

Recommended Posts

Hello,

 

I want to create an ore generation in only a few biomes, I don't know how, but it does not work.

Please, take a look at it.

 

This is the block I wanted to generate.

 

generateOreSand(Chef.oreSeaSaltOre, world, rand, x, z, 4, 8, 80, 50, 100, Blocks.sand);

 

This is my code that should generate an ore in a few biomes.

 

	public void generateOreSand(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Block generateIn) {
	int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
	int heightRange = maxY - minY;
	WorldGenMinableSand gen = new WorldGenMinableSand(block, vienSize, generateIn);
	BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);

	if(biome instanceof BiomeGenOcean || biome instanceof BiomeGenRiver || biome instanceof BiomeGenBeach) {
	for (int i = 0; i < chance; i++) {
		int xRand = chunkX * 16 + random.nextInt(16);
		int yRand = random.nextInt(heightRange) + minY;
		int zRand = chunkZ * 16 + random.nextInt(16);
		gen.generate(world, random, xRand, yRand, zRand);
		}
	}
}

 

If needed, this is the FULL java file.

 

http://pastebin.com/M7mfjGPA

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.