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

Guest
This topic is now closed to further replies.

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.