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

I have followed a tutorial and got my ores to generate in the regular Minecraft world, but I can't get it to generate in the Nether or the end. I already tried setting the values to get huge veins, and again, there are huge veins in the overworld but not a single ore in the Nether or the End. I have registered all the ores, and they are accessible through the Creative menu.

 

Here is my custom generation class that implements IWorldGenerator:

 

package eclipse.MoreApples.worldgen;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
import eclipse.MoreApples.common.MoreApples;

public class AppleIronIngotWorldGeneration implements IWorldGenerator {

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

	switch(world.provider.dimensionId){
	case -1:
		generateNether(world, random, chunkX * 16, chunkZ * 16);
		break;
	case 0:
		generateSurface(world, random, chunkX * 16, chunkZ * 16);
		break;
	case 1:
		generateEnd(world, random, chunkX * 16, chunkZ * 16);
		break;
	}

}

private void generateSurface(World world, Random random, int i, int j) {

	for(int k = 0; k < 10; k++){
		int chunkX = i + random.nextInt(16);
		int chunkY = random.nextInt(256);
		int chunkZ = j + random.nextInt(16);

		(new WorldGenMinable(MoreApples.appleIron_ore.blockID, 64)).generate(world, random, chunkX, chunkY, chunkZ);
	}
	int randomGemGeneration = (int) (Math.random() * 4 +1);

	for(int k = 0; k <randomGemGeneration ; k++){
		int chunkX = i + random.nextInt(16);
		int chunkY = random.nextInt(256);
		int chunkZ = j + random.nextInt(16);

		(new WorldGenMinable(MoreApples.appleGem_ore.blockID, 64)).generate(world, random, chunkX, chunkY, chunkZ);
	}

}

private void generateEnd(World world, Random random, int i, int j) {
	for(int k = 0; k < 10; k++){
		int chunkX = i + random.nextInt(16);
		int chunkY = random.nextInt(256);
		int chunkZ = j + random.nextInt(16);

		(new WorldGenMinable(MoreApples.appleEnder_ore.blockID, 64)).generate(world, random, chunkX, chunkY, chunkZ);
	}

}


private void generateNether(World world, Random random, int i, int j) {

	for(int k = 0; k < 15; k++){
		int chunkX = i + random.nextInt(16);
		int chunkY = random.nextInt(256);
		int chunkZ = j + random.nextInt(16);

		(new WorldGenMinable(MoreApples.appleFlame_ore.blockID, 64)).generate(world, random, chunkX, chunkY, chunkZ);
	}

}

}

 

 

 

Does anyone know what I did wrong?

 

Thanks for reading! =)

 

That's because you are using WorldGenMinable without specifying what type of block to replace. There is a three-parameter version of the constructor, the 3rd parameter of which is the block to replace; without that, it defaults to the stone block, of which there is none in the Nether. No blocks to replace = no custom blocks.

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.