refactor & add structures.json

This commit is contained in:
MihailRis
2024-09-24 04:05:13 +03:00
parent 519ebc05f1
commit 323c2f2935
20 changed files with 153 additions and 43 deletions
+3 -1
View File
@@ -7,7 +7,7 @@
#include "voxels/Block.hpp"
#include "voxels/Chunk.hpp"
#include "GeneratorDef.hpp"
#include "VoxelStructure.hpp"
#include "VoxelFragment.hpp"
#include "util/timeutil.hpp"
#include "util/listutil.hpp"
#include "debug/Logger.hpp"
@@ -259,6 +259,8 @@ void WorldGenerator::generate(voxel* voxels, int chunkX, int chunkZ) {
}
}
}
// TODO: put automatic placement here
for (const auto& placement : prototype.structures) {
if (placement.structure < 0 || placement.structure >= structures.size()) {