Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. package com.mod.drakania.world;
  2.  
  3. import java.util.Random;
  4.  
  5. import com.mod.drakania.init.BlockMod;
  6.  
  7. import cpw.mods.fml.common.IWorldGenerator;
  8. import net.minecraft.block.Block;
  9. import net.minecraft.init.Blocks;
  10. import net.minecraft.world.World;
  11. import net.minecraft.world.chunk.IChunkProvider;
  12. import net.minecraft.world.gen.feature.WorldGenMinable;
  13.  
  14. public class WorldGenDraka implements IWorldGenerator
  15.  
  16. {
  17.  
  18. @Override
  19. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  20. {
  21. switch(world.provider.dimensionId)
  22. {
  23. case -1:
  24. GenerateNether(world, chunkX * 16, chunkZ *16, random);
  25. case 0:
  26. GenerateOverWorld(world, chunkX * 16, chunkZ *16, random);
  27. case 1:
  28. Generateneend(world, chunkX * 16, chunkZ *16, random);
  29. }
  30.  
  31. }
  32.  
  33. private void addOre (Block block, Block blockSpawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minV, int maxV, int spawnchance)
  34. {
  35. for(int i = 0; i < spawnchance; i++)
  36. {
  37. int ChunkSize = 16;
  38. int Xpos = posX + random.nextInt(ChunkSize);
  39. int Ypos = minY + random.nextInt(maxY - minY);
  40. int Zpos = posZ + random.nextInt(ChunkSize);
  41.  
  42. new WorldGenMinable(block, maxV) .generate(world, random, Xpos, Ypos, Zpos);
  43.  
  44. }
  45. }
  46. private void Generateneend(World world, int i, int j, Random random)
  47. {
  48.  
  49.  
  50. }
  51.  
  52. private void GenerateOverWorld(World world, int i, int j, Random random)
  53. {
  54. addOre(BlockMod.drakanium_ore, Blocks.stone, random, world, i, j, 0, 12, 1, 8, 100);
  55. addOre(BlockMod.crystallium_ore, Blocks.stone, random, world, i, j, 0, 12, 1, 2, 90);
  56.  
  57. }
  58.  
  59. private void GenerateNether(World world, int i, int j, Random random)
  60. {
  61.  
  62.  
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement