migrate from dynamic::Value to dv::value & total erase namespace 'dynamic'
This commit is contained in:
@@ -15,10 +15,6 @@ class Lightmap;
|
||||
class ContentLUT;
|
||||
class Inventory;
|
||||
|
||||
namespace dynamic {
|
||||
class Map;
|
||||
}
|
||||
|
||||
using chunk_inventories_map =
|
||||
std::unordered_map<uint, std::shared_ptr<Inventory>>;
|
||||
|
||||
|
||||
@@ -746,8 +746,8 @@ void Chunks::save(Chunk* chunk) {
|
||||
)
|
||||
);
|
||||
auto entities = level->entities->getAllInside(aabb);
|
||||
auto root = dynamic::create_map();
|
||||
root->put("data", level->entities->serialize(entities));
|
||||
auto root = dv::object();
|
||||
root["data"] = level->entities->serialize(entities);
|
||||
if (!entities.empty()) {
|
||||
level->entities->despawn(std::move(entities));
|
||||
chunk->flags.entities = true;
|
||||
|
||||
@@ -66,8 +66,9 @@ std::shared_ptr<Chunk> ChunksStorage::create(int x, int z) {
|
||||
auto invs = regions.fetchInventories(chunk->x, chunk->z);
|
||||
chunk->setBlockInventories(std::move(invs));
|
||||
|
||||
if (auto map = regions.fetchEntities(chunk->x, chunk->z)) {
|
||||
level->entities->loadEntities(std::move(map));
|
||||
auto entitiesData = regions.fetchEntities(chunk->x, chunk->z);
|
||||
if (entitiesData.getType() == dv::value_type::object) {
|
||||
level->entities->loadEntities(std::move(entitiesData));
|
||||
chunk->flags.entities = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user