Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.dj.world;
- import com.dj.blocks.MBlocks;
- import cpw.mods.fml.common.IWorldGenerator;
- import java.util.Random;
- import net.minecraft.world.World;
- import net.minecraft.world.WorldProvider;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.feature.WorldGenMinable;
- import net.minecraft.world.gen.feature.WorldGenerator;
- public class OreGeneration
- implements IWorldGenerator
- {
- private WorldGenerator gen_GhostIron_ore;
- private WorldGenerator gen_Wither_ore;
- private WorldGenerator gen_Overyde_ore;
- private WorldGenerator gen_Abroatine;
- private WorldGenerator gen_Eternium;
- private WorldGenerator gen_Vuproynyx;
- private WorldGenerator gen_Xecrine;
- private WorldGenerator gen_Asnian;
- private WorldGenerator gen_Nucrium;
- public OreGeneration()
- {
- this.gen_GhostIron_ore = new WorldGenMinable(MBlocks.GhostIron, 5);
- this.gen_Wither_ore = new WorldGenMinable(MBlocks.WitherOre, 5);
- this.gen_Overyde_ore = new WorldGenMinable(MBlocks.OverydeOre, 5);
- this.gen_Abroatine = new WorldGenMinable(MBlocks.Abroatine, 5);
- this.gen_Eternium = new WorldGenMinable(MBlocks.Eternium, 5);
- this.gen_Vuproynyx = new WorldGenMinable(MBlocks.Vuproynyx, 5);
- this.gen_Xecrine = new WorldGenMinable(MBlocks.Xecrine, 5);
- this.gen_Asnian = new WorldGenMinable(MBlocks.Asnian, 5);
- this.gen_Nucrium = new WorldGenMinable(MBlocks.Nucrium, 5);
- }
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
- {
- switch (world.field_73011_w.field_76574_g)
- {
- case 0:
- runGenerator(this.gen_GhostIron_ore, world, random, chunkX, chunkZ, 40, 0, 40);
- runGenerator(this.gen_Wither_ore, world, random, chunkX, chunkZ, 40, 0, 40);
- runGenerator(this.gen_Overyde_ore, world, random, chunkX, chunkZ, 20, 0, 40);
- runGenerator(this.gen_Abroatine, world, random, chunkX, chunkZ, 5, 0, 20);
- runGenerator(this.gen_Eternium, world, random, chunkX, chunkZ, 5, 0, 20);
- runGenerator(this.gen_Vuproynyx, world, random, chunkX, chunkZ, 5, 0, 20);
- runGenerator(this.gen_Xecrine, world, random, chunkX, chunkZ, 5, 0, 20);
- runGenerator(this.gen_Asnian, world, random, chunkX, chunkZ, 5, 0, 10);
- runGenerator(this.gen_Nucrium, world, random, chunkX, chunkZ, 5, 0, 10);
- break;
- case -1:
- break;
- }
- }
- private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight)
- {
- if ((minHeight < 0) || (maxHeight > 256) || (minHeight > maxHeight)) {
- throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator");
- }
- int heightDiff = maxHeight - minHeight + 1;
- for (int i = 0; i < chancesToSpawn; i++)
- {
- int x = chunk_X * 16 + rand.nextInt(16);
- int y = minHeight + rand.nextInt(heightDiff);
- int z = chunk_Z * 16 + rand.nextInt(16);
- generator.func_76484_a(world, rand, x, y, z);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement