diff --git a/src/api/BlockAPI.cpp b/src/api/BlockAPI.cpp index 96ceaab4..3e7d0fb9 100644 --- a/src/api/BlockAPI.cpp +++ b/src/api/BlockAPI.cpp @@ -85,7 +85,7 @@ Local BlockClass::newBlock(Block const* p, BlockPos const* pos, int dim) } Local BlockClass::newBlock(BlockPos const* pos, int dim) { - Block bl = ll::service::getLevel()->getDimension(dim)->getBlockSourceFromMainChunkSource().getBlock(*pos); + auto& bl = ll::service::getLevel()->getDimension(dim)->getBlockSourceFromMainChunkSource().getBlock(*pos); return BlockClass::newBlock(&bl, pos, dim); } @@ -98,7 +98,7 @@ Local BlockClass::newBlock(Block const* p, BlockPos const* pos, BlockSou Local BlockClass::newBlock(IntVec4 pos) { BlockPos bp = {(float)pos.x, (float)pos.y, (float)pos.z}; - Block bl = ll::service::getLevel()->getDimension(pos.dim)->getBlockSourceFromMainChunkSource().getBlock(bp); + auto& bl = ll::service::getLevel()->getDimension(pos.dim)->getBlockSourceFromMainChunkSource().getBlock(bp); return BlockClass::newBlock(&bl, &bp, pos.dim); } @@ -337,7 +337,7 @@ Local BlockClass::getBlockState(const Arguments& args) { Local BlockClass::hasContainer(const Arguments& args) { try { - Block bl = ll::service::getLevel()->getDimension(pos.dim)->getBlockSourceFromMainChunkSource().getBlock( + auto& bl = ll::service::getLevel()->getDimension(pos.dim)->getBlockSourceFromMainChunkSource().getBlock( pos.getBlockPos() ); return Boolean::newBoolean(bl.isContainerBlock()); diff --git a/src/api/BlockEntityAPI.cpp b/src/api/BlockEntityAPI.cpp index d363947f..fa279fa2 100644 --- a/src/api/BlockEntityAPI.cpp +++ b/src/api/BlockEntityAPI.cpp @@ -103,7 +103,7 @@ Local BlockEntityClass::setNbt(const Arguments& args) { Local BlockEntityClass::getBlock(const Arguments& args) { try { BlockPos bp = blockEntity->getPosition(); - Block bl = ll::service::getLevel()->getDimension(dim)->getBlockSourceFromMainChunkSource().getBlock(bp); + auto& bl = ll::service::getLevel()->getDimension(dim)->getBlockSourceFromMainChunkSource().getBlock(bp); return BlockClass::newBlock(&bl, &bp, dim); } CATCH("Fail in getBlock!")