Advertisement
Dude_808

Minecraft Modding

Apr 18th, 2015
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. package com.dude_808.Main;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.minecraft.block.Block;
  6. import net.minecraft.world.World;
  7. import net.minecraft.world.chunk.IChunkProvider;
  8. import net.minecraft.world.gen.feature.WorldGenMinable;
  9.  
  10. import com.blocks.items.Stuff_I;
  11.  
  12. import cpw.mods.fml.common.IWorldGenerator;
  13.  
  14. public class WorldGeneration implements IWorldGenerator{
  15.  
  16. public static void initWorldGen(){}
  17.  
  18. private void generateSurface(World world, Random random, int x, int z)
  19. {
  20.  
  21. }
  22.  
  23. private void generateNether(World world, Random random, int x, int z)
  24. {
  25.  
  26. }
  27.  
  28. private void generateEnd(World world, Random random, int x, int z)
  29. {
  30.  
  31. }
  32.  
  33. private void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chanceToSpawn, int minY, int maxY)
  34. {
  35. for (int i = 0; i < chanceToSpawn; i++)
  36. {
  37. int posX = blockXPos + random.nextInt(maxX);
  38. int posY = minY + random.nextInt(maxY - minY);
  39. int posZ = blockZPos + random.nextInt(maxZ);
  40. new WorldGenMinable(block, maxVeinSize).generate(world, random, posX, posY, posZ);}
  41.  
  42. }
  43.  
  44. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  45. {
  46. switch (world.provider.dimensionId)
  47. {
  48. case 0:
  49. generateSurface(world, random, chunkX * 16, chunkZ * 16);
  50. addOreSpawn(Stuff_I.flickeriumore, world, random, chunkX, chunkZ, 16, 16, 4 + random.nextInt(3), 9, 35, 128);
  51. addOreSpawn(Stuff_I.blackironore, world, random, x, z, 16, 16 , 3 + random.nextInt(2), 3, 0, 11);
  52. case -1:
  53. generateNether(world, random, chunkX * 16, chunkZ * 16);
  54. case 1:
  55. generateEnd(world, random, chunkX * 16, chunkZ * 16);
  56. }
  57.  
  58. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement