WorldGenerator.cpp 416 B

1234567891011121314
  1. #include "server/world/WorldGenerator.h"
  2. #include "common/world/HighMap.h"
  3. void WorldGenerator::generate(World& w) {
  4. HighMap map(w.getSize(), w.getHeight());
  5. for(int x = 0; x < w.getSize(); x++) {
  6. for(int z = 0; z < w.getSize(); z++) {
  7. int height = map.getHeight(x, z);
  8. for(int y = 0; y < height; y++) {
  9. w.setBlock(x, y, z, 1);
  10. }
  11. }
  12. }
  13. }