12345678910111213141516 |
- #include "server/world/WorldGenerator.h"
- #include "common/world/HighMap.h"
- #include "server/Game.h"
- void WorldGenerator::generate(World& w) {
- const Block& stone = Game::blocks.getBlock("stone");
- HighMap map(w.getSize(), w.getHeight());
- for(int x = 0; x < w.getSize(); x++) {
- for(int z = 0; z < w.getSize(); z++) {
- int height = map.getHeight(x, z);
- for(int y = 0; y < height; y++) {
- w.setBlock(x, y, z, stone);
- }
- }
- }
- }
|