Posted April 24, 201411 yr package com.sapphire.world; import java.util.Random; import com.sapphire.items.blocks.MainBlocks; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; public class WorldGenSapphire implements IWorldGenerator{ public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){ switch(world.provider.dimensionId){ case -1: generateNether(world, rand, chunkX * 16, chunkZ * 16); case 0: generateSurface(world, rand, chunkX * 16, chunkZ * 16); case 1: generateEnd(world, rand, chunkX * 16, chunkZ * 16); } } private void generateSurface(World world, Random rand, int chunkX, int chunkZ){ for (int i = 0; i < 100; i++){ int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(64); int randPosZ = chunkZ + rand.nextInt(16); (new WorldGenMinable(MainBlocks.sapphireOre, 10)).generate(world, rand, randPosX, randPosY, randPosZ); } } private void generateNether(World world, Random rand, int chunkX, int chunkZ) { } private void generateEnd(World world, Random rand, int chunkX, int chunkZ){ for (int i = 0; i < 100; i++){ int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(64); int randPosZ = chunkZ + rand.nextInt(16); (new WorldGenMinable(MainBlocks.sapphireOre, 10)).generate(world, rand, randPosX, randPosY, randPosZ); } } } Don't tell me to learn the basics of java, I already know.
April 24, 201411 yr This maybe incorrect because last time I did ore gen not in the overworld was 1.4 but from what I remember worldgenmineable finds stone and replaces it with the ore that is specified. In the end however there is no stone to replace so nothing happens. So you will need to create your own worldgen class to replace endstone with your ore. Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
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.