Advertisement
totos51

MinealdWorldGenerator

Mar 24th, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. package Gallad.Mineald.world;
  2.  
  3. import java.util.Random;
  4.  
  5. import Gallad.Mineald.Import;
  6. import net.minecraft.block.Block;
  7. import net.minecraft.world.World;
  8. import net.minecraft.world.chunk.IChunkProvider;
  9. import net.minecraft.world.gen.feature.WorldGenMinable;
  10. import cpw.mods.fml.common.IWorldGenerator;
  11.  
  12. public class MinealdWorldGenerator implements IWorldGenerator {
  13. Random rand;
  14.  
  15. @Override
  16. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  17. {
  18. switch(world.provider.dimensionId)
  19. {
  20. case -1:
  21. this.generateEnd(world, chunkX * 16, chunkZ * 16, random);
  22. case 0:
  23. this.generateSurface(world, chunkX * 16, chunkZ * 16, random);
  24. case 1:
  25. this.generateNether(world, chunkX * 16, chunkZ * 16, random);
  26. case 2:
  27. this.generateDarkWorld(world, chunkX * 16, chunkZ * 16, random);
  28. }
  29. }
  30.  
  31. private void generateDarkWorld(World world, int x, int z, Random rand)
  32. {
  33. for(int i = 0; i < 1; i++)
  34. {
  35. (new WorldGenMinable(Import.RuboniteOre.blockID, 0, 5, Import.DarkStone.blockID)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(100), z + rand.nextInt(16));
  36. }
  37. if (rand.nextInt(100) == 1)
  38. {
  39. new DungeonTower().generate(world, rand, x + rand.nextInt(15), 63, z + rand.nextInt(16));
  40. }
  41. }
  42.  
  43. private void generateSurface(World world, int x, int z, Random rand)
  44. {
  45. for(int i = 0; i < 1; i++)
  46. {
  47. (new WorldGenMinable(Import.PhytriteOre.blockID, 0, 5, 1)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(70), z + rand.nextInt(16));
  48. }
  49. for(int j = 0; j < 2; j++)
  50. {
  51. (new WorldGenMinable(Import.KrakoniteOre.blockID, 0, 4, 1)).generate(world, rand, x + rand.nextInt(16), 21 + rand.nextInt(20), z + rand.nextInt(16));
  52. }
  53.  
  54. }
  55.  
  56. private void generateEnd(World world, int x, int z, Random rand)
  57. {
  58.  
  59. }
  60.  
  61. private void generateNether(World world, int x, int z, Random rand)
  62. {
  63. for(int i = 0; i < 3; i++)
  64. {
  65. (new WorldGenMinable(Import.RhuniteOre.blockID, 0, 8, Block.netherrack.blockID)).generate(world, rand, x + rand.nextInt(16), rand.nextInt(150), z + rand.nextInt(16));
  66. }
  67. }
  68.  
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement