Jump to content

Problem with WorldGeneration


Dramentiaras

Recommended Posts

Hi! I'm pretty new to modding and have a weird error with my world generation. This is my IWorldGenerator class:

 

package dramentiaras.crysathium.client.core;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
import dramentiaras.crysathium.common.CrysathiumMain;

public class CrysathiumOreGenerator implements IWorldGenerator {

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {

	BiomeGenBase biome = world.getBiomeGenForCoords(chunkX, chunkZ);


	for (int i = 0; i < 2; i++) {

		int randPosX = chunkX + random.nextInt(16);
		int randPosY = random.nextInt(32);
		int randPosZ = chunkZ + random.nextInt(16);

		(new WorldGenMinable(CrysathiumMain.blockOreCrysathium.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);

		System.out.println("Crysathium Ore generated at x: " + randPosX + " y:" + randPosY + " z:" + randPosZ);
	}

	for (int i = 0; i < 2; i++) {

		int randPosX = chunkX + random.nextInt(16);
		int randPosY = random.nextInt(32);
		int randPosZ = chunkZ + random.nextInt(16);

		(new WorldGenMinable(CrysathiumMain.blockOreHunitite.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);

		System.out.println("Hunitite Ore generated at x: " + randPosX + " y:" + randPosY + " z:" + randPosZ);
	}
}
}

 

However when I create a new world the x and z coords are almost the same (about the range of -40 to 40). My conclusion is that it's generating ore in the same chunk over and over again. When I go to the coords I find tons of ore veins (however it should only generate 2 per chunk) and in other chunks I find none. I have never seen anyone with this problem before and I would very much appreciate any help I can get!

Link to comment
Share on other sites

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.