Guest User

OreGenerator

a guest
Jul 31st, 2015
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. package na_t.example.testmod;
  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. import cpw.mods.fml.common.IWorldGenerator;
  10.  
  11. public class OreGenerator implements IWorldGenerator {
  12.  
  13. @Override
  14. public void generate(Random random, int chunkX, int chunkZ, World world,
  15. IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  16. {
  17.  
  18. switch(world.provider.dimensionId)
  19. {
  20. case -1 :
  21. generateInNether(world,random, chunkX*16, chunkZ*16);
  22. break;
  23. case 0 :
  24. generateInOverworld(world,random, chunkX*16, chunkZ*16);
  25. break;
  26. case 1 :
  27. generateInEnd(world,random, chunkX*16, chunkZ*16);
  28. break;
  29.  
  30. }
  31.  
  32. }
  33.  
  34. public void generateInEnd(World world, Random random, int x, int y)
  35. {
  36.  
  37. }
  38.  
  39. public void generateInOverworld(World world, Random random, int x, int z)
  40. {
  41. for(int i=0; i<25; i++) {
  42. int xcoord = x + random.nextInt(16);
  43. int ycoord = random.nextInt(32);
  44. int zcoord = z + random.nextInt(16);
  45. new WorldGenMinable(Generic.testoniumOre, 8).generate(world, random, xcoord, ycoord, zcoord);
  46. }
  47.  
  48. }
  49.  
  50. public void generateInNether(World world, Random random, int x, int y)
  51. {
  52.  
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment