feat: add getWorldBlockCount function to retrieve the total number of world blocks

This commit is contained in:
MayaTheShy
2026-03-22 11:45:04 -04:00
parent 34725d7d71
commit 6312e45bf1

View File

@@ -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