Advertisement
Guest User

Untitled

a guest
Sep 20th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. package tlhpoe.rpgadditions.worldgen;
  2.  
  3. import java.util.Random;
  4. import net.minecraft.block.Block;
  5. import net.minecraft.world.World;
  6. import net.minecraft.world.chunk.IChunkProvider;
  7. import tlhpoe.rpgadditions.helper.BlockHelper;
  8. import tlhpoe.rpgadditions.util.InfoUtil;
  9. import cpw.mods.fml.common.IWorldGenerator;
  10.  
  11. public class WorldGenEverything implements IWorldGenerator
  12. {
  13.  
  14. @Override
  15. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
  16. {
  17.  
  18. for(int l = 0; l < 8; ++l)
  19. {
  20.  
  21. int x = chunkX + random.nextInt(16);
  22.  
  23. int y = 128;
  24.  
  25. int z = chunkZ + random.nextInt(16);
  26.  
  27. while(!(world.getBlockId(x, y, z) == Block.grass.blockID))
  28. {--y;}
  29.  
  30. //if(world.getBlockId(x, y, z) == Block.grass.blockID)
  31. //{continue;}
  32.  
  33. world.setBlock(x, y+1, z, BlockHelper.heartFlower.blockID, 0, 2);
  34. InfoUtil.print("HI3");
  35.  
  36. }
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement