Skip to content

Commit

Permalink
add Bytearray support to world.set_chunk_data(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Jan 18, 2025
1 parent eaff564 commit c9adbe8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/logic/scripting/lua/libs/libworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ static void integrate_chunk_client(Chunk& chunk) {
static int l_set_chunk_data(lua::State* L) {
int x = static_cast<int>(lua::tointeger(L, 1));
int z = static_cast<int>(lua::tointeger(L, 2));
auto buffer = lua::touserdata<lua::LuaBytearray>(L, 3);
auto buffer = lua::require_bytearray(L, 3);
auto chunk = level->chunks->getChunk(x, z);
if (chunk == nullptr) {
return 0;
return lua::pushboolean(L, false);
}
compressed_chunks::decode(
*chunk, buffer->data().data(), buffer->data().size()
*chunk, buffer.data(), buffer.size()
);
if (controller->getChunksController()->lighting == nullptr) {
return lua::pushboolean(L, true);
Expand Down

0 comments on commit c9adbe8

Please sign in to comment.