Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package deathman12e3.MiningExpansion.common;
- import java.util.Random;
- 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 OreGenHandler implements IWorldGenerator
- {
- 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);
- case 0: generateSurface(world, random, chunkX*16, chunkZ*16);
- }
- }
- private void generateSurface(World world, Random random, int blockX, int blockZ)
- {
- for (int x = 0; x < 80; x++)
- {
- int Xcoord = blockX + random.nextInt(16);
- int Ycoord = random.nextInt(100);
- int Zcoord = blockZ + random.nextInt(16);
- (new WorldGenMinable(BaseMod.copperOre.blockID, random.nextInt(8))).generate(world, random, Xcoord, Ycoord, Zcoord);
- }
- for (int x = 0; x < 20; x++)
- {
- int Xcoord = blockX + random.nextInt(16);
- int Ycoord = random.nextInt(100);
- int Zcoord = blockZ + random.nextInt(16);
- (new WorldGenMinable(BaseMod.tinOre.blockID, random.nextInt(8))).generate(world, random, Xcoord, Ycoord, Zcoord);
- }
- for (int x = 0; x < 10; x++)
- {
- int Xcoord = blockX + random.nextInt(16);
- int Ycoord = random.nextInt(29);
- int Zcoord = blockZ + random.nextInt(16);
- (new WorldGenMinable(BaseMod.cobaltOre.blockID, random.nextInt(8))).generate(world, random, Xcoord, Ycoord, Zcoord);
- }
- }
- private void generateNether(World world, Random random, int blockX, int blockZ)
- {
- for (int x = 0; x < 1000; x++)
- {
- int Xcoord = blockX + random.nextInt(16);
- int Ycoord = random.nextInt(100);
- int Zcoord = blockZ + random.nextInt(16);
- (new WorldGenMinable(BaseMod.onyxOre.blockID, random.nextInt(8))).generate(world, random, Xcoord, Ycoord, Zcoord);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment