Jump to content

Ore is not Generating


shucke

Recommended Posts

Hello,

i made a new dimension and now im trying to generate ores in that dimension.

but somehow it doesnt generate any ores in the dimension.

when i start up minecraft it does print the line i setup in the generation method in the eclipse console but just for the normal dimension.

 

anyway here is my code.

and i did registered the dimension on id nr 7.

 

public class WorldGenerator implements IWorldGenerator{

private boolean alreadyRendered = false;

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
		IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
	int id = world.provider.dimensionId;
	switch(id){
		case 0:
			//generateWatchtower(world, random, chunkX*16, chunkZ*16);
		break;

		case 7:
			System.out.println("generating 7 called");
			generateBeach(world, random, chunkX*16, chunkZ*16);
		break;
	}
}

private void generateBeach(World world, Random random, int i, int j) {
	generatePalmTree(world, random, i*16, j*16);
	genrateAquaticOre(world, random, i*16, j*16);
}

private void genrateAquaticOre(World world, Random random, int i, int j) {
	int Xcoord = i + random.nextInt(16);
	int Ycoord = random.nextInt(60);
	int Zcoord = j + random.nextInt(16);

	for(int k = 0; k < 50; k++){
		(new WorldGenMinable(BaseLegendz.aquaticOre.blockID, 4)).generate(world, random, Xcoord, Ycoord, Zcoord);
	}
}

private void generatePalmTree(World world, Random random, int i, int j) {
		  int Xcoord1 = i + random.nextInt(16);
		  int Zcoord1 = j + random.nextInt(16);
		  
		  for(int var1 = 0; var1 < 80; var1++){
			  if(world.canBlockSeeTheSky(Xcoord1, var1, Zcoord1) && world.getBlockId(Xcoord1, var1, Zcoord1) == Block.sand.blockID){
				  new WorldGenPalmTree().generate(world, random, Xcoord1, var1+1, Zcoord1);
				  System.out.println("generated a palm tree!");
			  }
		  }
}
}

 

the palm tree's arent generating aswell so i think there is something wrong with my switch statement.

because they do generate when i just put them in the generate() methoed

 

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.



×
×
  • Create New...

Important Information

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