Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Gallad.Mineald.world;
- import java.util.Random;
- import Gallad.Mineald.Import;
- import net.minecraft.block.Block;
- import net.minecraft.world.World;
- import net.minecraft.world.chunk.IChunkProvider;
- import net.minecraft.world.gen.feature.WorldGenMinable;
- import cpw.mods.fml.common.IWorldGenerator;
- public class MinealdWorldGenerator implements IWorldGenerator {
- Random rand;
- @Override
- public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
- {
- switch(world.provider.dimensionId)
- {
- case -1:
- this.generateEnd(world, chunkX * 16, chunkZ * 16, random);
- case 0:
- this.generateSurface(world, chunkX * 16, chunkZ * 16, random);
- case 1:
- this.generateNether(world, chunkX * 16, chunkZ * 16, random);
- case 2:
- this.generateDarkWorld(world, chunkX * 16, chunkZ * 16, random);
- }
- }
- private void generateDarkWorld(World world, int x, int z, Random rand)
- {
- for(int i = 0; i < 1; i++)
- {
- (new WorldGenMinable(Import.RuboniteOre.blockID, 0, 5, Import.DarkStone.blockID)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(100), z + rand.nextInt(16));
- }
- if (rand.nextInt(100) == 1)
- {
- new DungeonTower().generate(world, rand, x + rand.nextInt(15), 63, z + rand.nextInt(16));
- }
- }
- private void generateSurface(World world, int x, int z, Random rand)
- {
- for(int i = 0; i < 1; i++)
- {
- (new WorldGenMinable(Import.PhytriteOre.blockID, 0, 5, 1)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(70), z + rand.nextInt(16));
- }
- for(int j = 0; j < 2; j++)
- {
- (new WorldGenMinable(Import.KrakoniteOre.blockID, 0, 4, 1)).generate(world, rand, x + rand.nextInt(16), 21 + rand.nextInt(20), z + rand.nextInt(16));
- }
- }
- private void generateEnd(World world, int x, int z, Random rand)
- {
- }
- private void generateNether(World world, int x, int z, Random rand)
- {
- for(int i = 0; i < 3; i++)
- {
- (new WorldGenMinable(Import.RhuniteOre.blockID, 0, 8, Block.netherrack.blockID)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(150), z + rand.nextInt(16));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement