mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
move block set logic to the blocks_agent
This commit is contained in:
parent
6157f8193d
commit
87c19d69dc
7 changed files with 210 additions and 133 deletions
|
|
@ -98,7 +98,7 @@ static int l_set(lua::State* L) {
|
|||
if (!level->chunks->get(x, y, z)) {
|
||||
return 0;
|
||||
}
|
||||
level->chunks->set(x, y, z, id, int2blockstate(state));
|
||||
blocks_agent::set(*level->chunksStorage, x, y, z, id, int2blockstate(state));
|
||||
level->lighting->onBlockSet(x, y, z, id);
|
||||
if (!noupdate) {
|
||||
blocks->updateSides(x, y, z);
|
||||
|
|
@ -269,7 +269,9 @@ static int l_is_replaceable_at(lua::State* L) {
|
|||
auto x = lua::tointeger(L, 1);
|
||||
auto y = lua::tointeger(L, 2);
|
||||
auto z = lua::tointeger(L, 3);
|
||||
return lua::pushboolean(L, level->chunks->isReplaceableBlock(x, y, z));
|
||||
return lua::pushboolean(
|
||||
L, blocks_agent::is_replaceable_at(*level->chunksStorage, x, y, z)
|
||||
);
|
||||
}
|
||||
|
||||
static int l_caption(lua::State* L) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue