This commit is contained in:
MihailRis
2024-08-11 18:21:12 +03:00
parent 3d3da1cdcd
commit 4f2448daed
9 changed files with 46 additions and 35 deletions
+8
View File
@@ -7,6 +7,8 @@
#include "files/files.hpp"
#include "items/ItemDef.hpp"
#include "voxels/Block.hpp"
#include "world/World.hpp"
#include "files/WorldFiles.hpp"
#include "Content.hpp"
ContentLUT::ContentLUT(
@@ -24,8 +26,14 @@ static constexpr size_t get_entries_count(
}
std::shared_ptr<ContentLUT> ContentLUT::create(
const std::shared_ptr<WorldFiles>& worldFiles,
const fs::path& filename, const Content* content
) {
auto worldInfo = worldFiles->readWorldInfo();
if (!worldInfo.has_value()) {
return nullptr;
}
auto root = files::read_json(filename);
auto blocklist = root->list("blocks");
auto itemlist = root->list("items");