Guest User

NetherOreGenHandler

a guest
Feb 10th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. package deathman12e3.MiningExpansion.common;
  2.  
  3. import java.util.Random;
  4.  
  5. import cpw.mods.fml.common.IWorldGenerator;
  6. import net.minecraft.world.World;
  7. import net.minecraft.world.chunk.IChunkProvider;
  8. import net.minecraft.world.gen.feature.WorldGenMinable;
  9.  
  10. public class NetherOreGenHandler implements IWorldGenerator
  11. {
  12.  
  13. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  14. {
  15.  
  16. generateNether(world, random, chunkX*16, chunkZ*16);
  17.  
  18. }
  19.  
  20. private void generateNether(World world, Random random, int blockX, int blockZ)
  21. {
  22.  
  23. for (int x = 0; x < 600; x++)
  24. {
  25.  
  26. int Xcoord = blockX + random.nextInt(16);
  27. int Ycoord = random.nextInt(100);
  28. int Zcoord = blockZ + random.nextInt(16);
  29.  
  30. (new WorldGenMinable(BaseMod.onyxOre.blockID, random.nextInt(8))).generate(world, random, Xcoord, Ycoord, Zcoord);
  31. }
  32.  
  33. }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment