Example #1
0
 @Override
 public void populate(Chunk chunk, Random random) {
   if (chunk.getY() != 4) {
     return;
   }
   final World world = chunk.getWorld();
   if (random.nextInt(WATER_ODD) == 0) {
     final int x = chunk.getBlockX(random);
     final int z = chunk.getBlockZ(random);
     final int y = random.nextInt(128);
     WATER_POND.setRandom(random);
     WATER_POND.randomize();
     if (WATER_POND.canPlaceObject(world, x, y, z)) {
       WATER_POND.placeObject(world, x, y, z);
     }
   }
   if (random.nextInt(LAVA_ODD) == 0) {
     final int x = chunk.getBlockX(random);
     final int z = chunk.getBlockZ(random);
     final int y = random.nextInt(120) + 8;
     if (y >= 63 && random.nextInt(LAVA_SURFACE_ODD) != 0) {
       return;
     }
     LAVA_POND.setRandom(random);
     LAVA_POND.randomize();
     if (LAVA_POND.canPlaceObject(world, x, y, z)) {
       LAVA_POND.placeObject(world, x, y, z);
     }
   }
 }