From 4682c4ec309d8e2e171dd8c1b95486042310c704 Mon Sep 17 00:00:00 2001
From: TomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>
Date: Wed, 10 Jan 2024 22:00:07 +0100
Subject: [PATCH] Fix desc default value & cmds behind execute
---
assets/analyzer.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/assets/analyzer.js b/assets/analyzer.js
index f61f31d..f007e78 100644
--- a/assets/analyzer.js
+++ b/assets/analyzer.js
@@ -121,12 +121,14 @@ async function processEntries(entries) {
if (cmd == "execute") {
const matches = / run ([a-z_:]{2,})/g.exec(line)
if (matches) matches.forEach(match => {
- if (cmdsBehindExecute[match[1]]) cmdsBehindExecute[match[1]]++
- else cmdsBehindExecute[match[1]] = 1
- if (commands[match[1]]) commands[match[1]]++
- else commands[match[1]] = 1
+ const cmdBehind = match.replace("run ", "").trim()
- if (match[1] == "return") {
+ if (cmdsBehindExecute[cmdBehind]) cmdsBehindExecute[cmdBehind]++
+ else cmdsBehindExecute[cmdBehind] = 1
+ if (commands[cmdBehind]) commands[cmdBehind]++
+ else commands[cmdBehind] = 1
+
+ if (cmdBehind == "return") {
const returnCmd = / run return run ([a-z_:]{2,})/g.exec(line)
if (returnCmd && returnCmd[1]) {
if (cmdsBehindReturn[returnCmd[1]]) cmdsBehindReturn[returnCmd[1]]++
@@ -352,7 +354,7 @@ async function mainScan(hasData = false) {
}
}
- let description = "No description"
+ let description = ""
if (pack.pack && pack.pack.description) {
if (typeof pack.pack.description == "object") {
const desc = Array.isArray(pack.pack.description) ? pack.pack.description : [pack.pack.description]
@@ -360,7 +362,7 @@ async function mainScan(hasData = false) {
if (d.text || d.translation) description += d.text || d.translation
})
} else description = pack.pack.description
- }
+ } else description = "No description"
return "" + description.replace(/ยง[0-9a-flmnor]/gi, "") +
(window.versions.some(ver => (rpMode ? ver.resourcepack_version : ver.datapack_version) == pack.pack.pack_format) ?