Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.