From d65a4091b13a0191792d278375ebb8d294226d9a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 17 Jun 2023 19:27:55 +0000 Subject: count teleporters in analyzeChunks.js --- analyzeChunks.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/analyzeChunks.js b/analyzeChunks.js index 6848763..494ac1b 100644 --- a/analyzeChunks.js +++ b/analyzeChunks.js @@ -11,6 +11,8 @@ var chunkMetadataLength = 1000; var chunkEntryLength = chunkMetadataLength + chunkDataLength; var OVEN_TILE = 149; +var TELEPORTER_START_TILE = 151; +var TELEPORTER_TILE_AMOUNT = 4; function getChunkCountInFile(file) { var tempStats = fs.fstatSync(file); @@ -30,6 +32,7 @@ while (index < tempNameList.length) { var generatedChunkCount = 0; var ovenCount = 0; +var teleporterCount = 0; function analyzeChunkBuffer(buffer) { var index = 0; @@ -41,6 +44,9 @@ function analyzeChunkBuffer(buffer) { if (tempTile == OVEN_TILE) { ovenCount += 1; } + if (TELEPORTER_START_TILE <= tempTile && tempTile < TELEPORTER_START_TILE+TELEPORTER_TILE_AMOUNT) { + teleporterCount += 1; + } index += chunkTileLength; } generatedChunkCount += 1; @@ -68,5 +74,6 @@ while (index < tempPathList.length) { console.log("Generated chunk count: " + generatedChunkCount); console.log("Oven count: " + ovenCount); +console.log("Teleporter count: " + teleporterCount); -- cgit v1.2.3