World structure update + new blocks

This commit is contained in:
MihailRis
2023-11-24 02:20:13 +03:00
parent cc556bc19b
commit 275e4af9fd
9 changed files with 70 additions and 4 deletions
+4 -1
View File
@@ -5,6 +5,7 @@
#include "Level.h"
#include "../files/WorldFiles.h"
#include "../content/Content.h"
#include "../voxels/Chunk.h"
#include "../voxels/Chunks.h"
#include "../voxels/ChunksStorage.h"
@@ -29,6 +30,8 @@ World::~World(){
}
void World::write(Level* level) {
const Content* content = level->content;
Chunks* chunks = level->chunks;
for (size_t i = 0; i < chunks->volume; i++) {
@@ -38,7 +41,7 @@ void World::write(Level* level) {
wfile->put(chunk.get());
}
wfile->write(WorldInfo {name, wfile->directory, seed});
wfile->write(WorldInfo {name, wfile->directory, seed}, content);
wfile->writePlayer(level->player);
}