Guest User

OreGenHandler

a guest
Feb 9th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 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 OreGenHandler implements IWorldGenerator
  11. {
  12.  
  13. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  14. {
  15.  
  16. generateSurface(world, random, chunkX*16, chunkZ*16);
  17.  
  18. }
  19.  
  20. private void generateSurface(World world, Random random, int blockX, int blockZ)
  21. {
  22.  
  23. int Xcoord = blockX + random.nextInt(16);
  24. int Ycoord = random.nextInt(100);
  25. int Zcoord = blockZ + random.nextInt(16);
  26.  
  27. (new WorldGenMinable(BaseMod.copperOre.blockID, random.nextInt(8))).generate(world, random, Xcoord, Ycoord, Zcoord);
  28.  
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment