summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-06-17 19:27:55 +0000
committerubq323 <ubq323@ubq323.website>2023-06-17 19:27:55 +0000
commitd65a4091b13a0191792d278375ebb8d294226d9a (patch)
tree2e40db574c031d56229ad3063097b14a076ed42b
parentacc03188697a56605e1108b0f502b5f0838cd7f3 (diff)
count teleporters in analyzeChunks.js
-rw-r--r--analyzeChunks.js7
1 files changed, 7 insertions, 0 deletions
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);