mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 21:11:50 +00:00
Merge branch 'main' into heightmaps
This commit is contained in:
commit
bf9f81a98c
74 changed files with 1885 additions and 1782 deletions
|
|
@ -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>>;
|
||||
|
||||
|
|
|
|||
|
|
@ -664,8 +664,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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue