feat: add getWorldBlockCount function to retrieve the total number of world blocks
This commit is contained in:
@@ -288,6 +288,11 @@ export function getWorldBlocks(limit = 10000) {
|
|||||||
return stmt.all(limit);
|
return stmt.all(limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getWorldBlockCount() {
|
||||||
|
const row = db.prepare('SELECT COUNT(*) as cnt FROM world_blocks').get();
|
||||||
|
return row ? row.cnt : 0;
|
||||||
|
}
|
||||||
|
|
||||||
export function getWorldBlocksInArea(minX, minY, minZ, maxX, maxY, maxZ) {
|
export function getWorldBlocksInArea(minX, minY, minZ, maxX, maxY, maxZ) {
|
||||||
const stmt = db.prepare(`
|
const stmt = db.prepare(`
|
||||||
SELECT * FROM world_blocks
|
SELECT * FROM world_blocks
|
||||||
|
|||||||
Reference in New Issue
Block a user