mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
feat: loading entities (WIP)
This commit is contained in:
parent
08cc78289d
commit
c8666910ce
16 changed files with 129 additions and 38 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "Block.hpp"
|
||||
#include "../content/Content.hpp"
|
||||
#include "../files/WorldFiles.hpp"
|
||||
#include "../objects/Entities.hpp"
|
||||
#include "../world/Level.hpp"
|
||||
#include "../world/World.hpp"
|
||||
#include "../maths/voxmaths.hpp"
|
||||
|
|
@ -63,6 +64,10 @@ 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));
|
||||
}
|
||||
|
||||
chunk->flags.loaded = true;
|
||||
for(auto& entry : chunk->inventories) {
|
||||
level->inventories->store(entry.second);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue