move Chunks from Level to Player

This commit is contained in:
MihailRis
2024-12-17 19:40:00 +03:00
parent b7664b4188
commit 1c18c02092
40 changed files with 450 additions and 220 deletions
+2 -1
View File
@@ -14,6 +14,7 @@
#include "voxels/Block.hpp"
#include "voxels/Chunks.hpp"
#include "voxels/voxel.hpp"
#include "voxels/blocks_agent.hpp"
#include "world/Level.hpp"
#include "api_lua.hpp"
@@ -59,7 +60,7 @@ static int l_open_block(lua::State* L) {
auto z = lua::tointeger(L, 3);
bool playerInventory = !lua::toboolean(L, 4);
auto vox = level->chunks->get(x, y, z);
auto vox = blocks_agent::get(*level->chunksStorage, x, y, z);
if (vox == nullptr) {
throw std::runtime_error(
"block does not exists at " + std::to_string(x) + " " +