From 875318db04dbb35eda9531e1333e6b70a1683c8e Mon Sep 17 00:00:00 2001 From: Holly Date: Wed, 8 Nov 2023 15:44:46 +0000 Subject: [PATCH] improve initial generation logging --- server/MinecraftServer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/MinecraftServer.ts b/server/MinecraftServer.ts index 92b212d..3652839 100644 --- a/server/MinecraftServer.ts +++ b/server/MinecraftServer.ts @@ -136,16 +136,20 @@ export class MinecraftServer { let timer = Date.now(); await this.worlds.forEach(async world => { + timer = Date.now(); let chunksGenerated = 0; + let chunksPerSecond = 0; Console.printInfo(`Generating spawn area for DIM${world.dimension}...`); for (let x = chunkFrom; x < chunkTo; x++) { for (let z = chunkFrom; z < chunkTo; z++) { const chunk = await world.getChunkSafe(x, z); chunk.forceLoaded = true; chunksGenerated++; + chunksPerSecond++; if (Date.now() - timer >= 1000) { - Console.printInfo(`DIM${world.dimension} Progress [${chunksGenerated}/${chunkCount}] ${((chunksGenerated / chunkCount) * 100).toFixed(2)}%`); + Console.printInfo(`DIM${world.dimension} Progress [${chunksGenerated}/${chunkCount}] (${chunksPerSecond} chunks/s) ${((chunksGenerated / chunkCount) * 100).toFixed(2)}%`); timer = Date.now(); + chunksPerSecond = 0; } } }