diff --git a/assets/script.js b/assets/script.js index d4b3f0f..b5c94af 100644 --- a/assets/script.js +++ b/assets/script.js @@ -45,8 +45,11 @@ let dpExclusive = { datapacks: 0, dimension: 0, dimension_type: 0, + enchantment: 0, + enchantment_provider: 0, item_modifiers: 0, loot_tables: 0, + painting_variant: 0, predicates: 0, recipes: 0, structures: 0, @@ -96,22 +99,13 @@ let rpExclusive = { lang: 0, models: 0, particles: 0, + resourcepacks: 0, shaders: 0, sounds: 0, texts: 0, textures: 0 } -const openDialog = dialog => { - dialog.style.display = "block" - dialog.getElementsByClassName("close")[0].onclick = function() { - dialog.style.display = "none" - } - window.onclick = function(event) { - if (event.target == dialog) dialog.style.display = "none" - } -} - const encode = s => s.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'") const localize = str => typeof str == "number" ? str.toLocaleString() : encode(str) + " (Please report if you see this)" @@ -134,11 +128,11 @@ const createImage = () => { let y = 1 const lineHeight = 21 const maxWidth = 400 - ctx.font = lineHeight - 1 + "px Arial" + ctx.font = (lineHeight - 1) + "px Arial" ctx.fillStyle = "black" if (packFiles.length > 0) { - ctx.fillText(packFiles.length + " " + (rpMode ? "Resource" : "Data") + "pack" + (packFiles.length == 1 ? "" : "s") + " found", x, y++ * lineHeight, maxWidth) + ctx.fillText(packFiles.length + " " + (rpMode ? "Resource" : "Data") + " pack" + (packFiles.length == 1 ? "" : "s") + " found", x, y++ * lineHeight, maxWidth) packFiles.forEach(pack => { if (pack.features?.enabled?.length > 0) { ctx.fillText("Selected internal features:", x + 30, y++ * lineHeight, maxWidth) @@ -232,16 +226,16 @@ const share = async type => { body: JSON.stringify({ name, date: Date.now() + 1000 * 60 * 60 * 24 * 30, - url: location.href + "?data=" + encodeURIComponent(content) + url: (location.protocol == "https:" ? location.href : "https://pack-analyzer.pages.dev/") + "?data=" + encodeURIComponent(content) }) }) const json = await res.json() if (res.ok) { - document.getElementById("share-link").href = "https://sh0rt.zip/" + name - document.getElementById("share-link").innerText = "https://sh0rt.zip/" + name + document.getElementById("share-link").href = encode(json.uri) + document.getElementById("share-link").innerText = json.uri document.getElementById("share-img").src = "https://sh0rt.zip/qr/" + name - openDialog(document.getElementById("shareDialog")) + document.getElementById("shareDialog").showModal() } else alert("Couldn't create link: " + json.error) return } @@ -253,144 +247,6 @@ const share = async type => { download.click() } -window.addEventListener("DOMContentLoaded", () => { - if (localStorage.getItem("theme") == "light") document.body.classList.add("light") - else if (window.matchMedia("(prefers-color-scheme: light)").matches) { - document.body.classList.add("light") - localStorage.setItem("theme", "light") - } - - const params = new URLSearchParams(location.search) - if (params.has("data")) { - const parsed = JSON.parse(params.get("data")) - files = parsed.files - done = parsed.done - error = parsed.error - rpMode = parsed.rpMode - document.getElementById("radiorp").checked = rpMode - - filetypes = parsed.filetypes - packFiles = parsed.packFiles - commands = parsed.commands - cmdsBehindExecute = parsed.cmdsBehindExecute - cmdsBehindMacros = parsed.cmdsBehindMacros - cmdsBehindReturn = parsed.cmdsBehindReturn - comments = parsed.comments - empty = parsed.empty - emptyFiles = parsed.emptyFiles - dpExclusive = parsed.dpExclusive - rpExclusive = parsed.rpExclusive - - mainScan(true) - } - - document.getElementById("clear-results").addEventListener("click", () => { - document.getElementById("progress").innerText = "" - document.getElementById("result").innerHTML = "" - document.getElementById("resultButtons").setAttribute("hidden", "") - document.getElementById("shareImage").style.display = "none" - if (interval) clearInterval(interval) - }) - document.getElementById("toggle-theme").addEventListener("click", () => { - localStorage.setItem("theme", document.body.classList.toggle("light") ? "light" : "dark") - }) - document.getElementById("about-button").addEventListener("click", () => openDialog(document.getElementById("aboutDialog"))) - - document.getElementById("select-folder").addEventListener("click", () => { - if (interval) clearInterval(interval) - selected = null - - const input = document.createElement("input") - input.type = "file" - input.webkitdirectory = true - input.onchange = e => { - selected = e.target.files - mainScan() - } - if ("showPicker" in HTMLInputElement.prototype) input.showPicker() - else input.click() - }) - document.getElementById("select-zip").addEventListener("click", () => { - if (interval) clearInterval(interval) - - const input = document.createElement("input") - input.type = "file" - input.accept = ".zip" - input.onchange = e => handleZip(e.target.files[0]) - - if ("showPicker" in HTMLInputElement.prototype) input.showPicker() - else input.click() - }) - - for (const elem of document.getElementsByClassName("share")) elem.addEventListener("click", () => share(elem.dataset.type)) - - if (location.protocol == "https:" && "serviceWorker" in navigator) navigator.serviceWorker.register("/serviceworker.js") -}) - -window.addEventListener("dragover", event => { - event.stopPropagation() - event.preventDefault() - event.dataTransfer.dropEffect = "copy" -}) -window.addEventListener("drop", async event => { - event.stopPropagation() - event.preventDefault() - const fileList = event.dataTransfer.files - if (fileList.length == 0) return - - const dropElement = document.createElement("div") - dropElement.id = "drop" - dropElement.style.left = event.clientX + "px" - dropElement.style.top = event.clientY + "px" - document.body.appendChild(dropElement) - dropElement.addEventListener("animationend", () => dropElement.remove()) - - if (fileList[0].name.endsWith(".zip")) handleZip(fileList[0]) - else { - selected = [] - for await (const file of Object.values(fileList)) { - try { - selected.push({ - name: file.name, - content: await file.text() - }) - } catch (e) { - console.error(e) - alert("Couldn't read file: " + file.name + "\nYour browser may not support reading files/folders by dropping them on a website, try using the buttons above.") - } - } - mainScan() - } -}) -window.addEventListener("paste", async event => { - event.preventDefault() - if (event.clipboardData.files.length == 0) { - if (event.clipboardData.items.length > 0) event.clipboardData.items[0].getAsString(str => { - selected = [{name: "clipboard.mcfunction", content: str}] - mainScan() - }) - return - } - - const fileList = event.clipboardData.files - if (fileList[0].name.endsWith(".zip")) handleZip(fileList[0]) - else { - selected = [] - for await (const file of Object.values(fileList)) { - try { - selected.push({ - name: file.name, - content: await file.text() - }) - } catch (e) { - console.error(e) - alert("Couldn't read file: " + file.name + "\nYour browser may not support reading files/folders from the clipboard, try using the buttons above.") - } - } - mainScan() - } -}) - const processFile = async (filePath = "", name = "", loadContentCallback = () => {}) => { const ext = name.split(".").pop() if ( @@ -407,7 +263,7 @@ const processFile = async (filePath = "", name = "", loadContentCallback = () => if ( ext == "mcfunction" || ext == "mcmeta" || (!rpMode && ext == "json" && (filePath.includes("/advancements/") || filePath.includes("/tags/functions/"))) || - ext == "fsh" || ext == "vsh" || ext == "glsl" || name.endsWith("pack.png") + ext == "fsh" || ext == "vsh" || ext == "glsl" || name.endsWith("/pack.png") ) { files++ @@ -565,7 +421,7 @@ const processFile = async (filePath = "", name = "", loadContentCallback = () => }) } -async function processEntries(entries) { +const processEntries = async entries => { for await (const entry of entries) { const filePath = entry.webkitRelativePath || entry.name if (filePath.includes("/.git/") || filePath.includes("/.svn/")) continue @@ -594,7 +450,7 @@ async function processEntries(entries) { } } -async function mainScan(hasData = false) { +const mainScan = async (hasData = false) => { if (interval) clearInterval(interval) document.getElementById("result").innerHTML = "" @@ -624,8 +480,11 @@ async function mainScan(hasData = false) { datapacks: 0, dimension: 0, dimension_type: 0, + enchantment: 0, + enchantment_provider: 0, item_modifiers: 0, loot_tables: 0, + painting_variant: 0, predicates: 0, recipes: 0, structures: 0, @@ -675,6 +534,7 @@ async function mainScan(hasData = false) { lang: 0, models: 0, particles: 0, + resourcepacks: 0, shaders: 0, sounds: 0, texts: 0, @@ -691,7 +551,7 @@ async function mainScan(hasData = false) { if (files == 0) return document.getElementById("progress").innerText = "No files found!" document.getElementById("resultButtons").removeAttribute("hidden") if (error == 0) document.getElementById("progress").innerText = "" - if (Object.values(filetypes).reduce((a, b) => a + b) == 0) document.getElementById("progress").innerHTML = "No " + (rpMode ? "resource" : "data") + "pack files found!" + if (Object.values(filetypes).reduce((a, b) => a + b) == 0) document.getElementById("progress").innerHTML = "No " + (rpMode ? "resource" : "data") + " pack files found!" const uncalledFunctions = dpExclusive.functions.filter(funcName => !dpExclusive.functionCalls.some(func => func.target == funcName)) const missingFunctions = [...new Set(dpExclusive.functionCalls.filter(func => !dpExclusive.functions.includes(func.target)).map(func => func.target))] @@ -702,7 +562,7 @@ async function mainScan(hasData = false) { const versions = localStorage.getItem("mcVersions") ? JSON.parse(localStorage.getItem("mcVersions")) : [] let html = (packImages.length > 0 ? "
" + packImages.map(img => "") + "
" : "") + - (packFiles.length > 0 ? "" + (rpMode ? "Resource" : "Data") + "pack" + (packFiles.length == 1 ? "" : "s") + " found:
" + + (packFiles.length > 0 ? "" + (rpMode ? "Resource" : "Data") + " pack" + (packFiles.length == 1 ? "" : "s") + " found:
" + packFiles.map(pack => { let oldestFormat = pack.pack.pack_format let newestFormat = pack.pack.pack_format @@ -820,7 +680,7 @@ async function mainScan(hasData = false) { }, 100) } -function handleZip(file) { +const handleZip = file => { selected = [] new JSZip().loadAsync(file).then(async zip => { @@ -833,3 +693,150 @@ function handleZip(file) { mainScan() }) } + +window.addEventListener("DOMContentLoaded", () => { + if (localStorage.getItem("theme") == "light") document.body.classList.add("light") + else if (window.matchMedia("(prefers-color-scheme: light)").matches) { + document.body.classList.add("light") + localStorage.setItem("theme", "light") + } + + const params = new URLSearchParams(location.search) + if (params.has("data")) { + const parsed = JSON.parse(params.get("data")) + files = parsed.files + done = parsed.done + error = parsed.error + rpMode = parsed.rpMode + document.getElementById("radiorp").checked = rpMode + + filetypes = parsed.filetypes + packFiles = parsed.packFiles + commands = parsed.commands + cmdsBehindExecute = parsed.cmdsBehindExecute + cmdsBehindMacros = parsed.cmdsBehindMacros + cmdsBehindReturn = parsed.cmdsBehindReturn + comments = parsed.comments + empty = parsed.empty + emptyFiles = parsed.emptyFiles + dpExclusive = parsed.dpExclusive + rpExclusive = parsed.rpExclusive + + mainScan(true) + } + + document.getElementById("clear-results").addEventListener("click", () => { + document.getElementById("progress").innerText = "" + document.getElementById("result").innerHTML = "" + document.getElementById("resultButtons").setAttribute("hidden", "") + document.getElementById("shareImage").style.display = "none" + if (interval) clearInterval(interval) + }) + document.getElementById("toggle-theme").addEventListener("click", () => { + localStorage.setItem("theme", document.body.classList.toggle("light") ? "light" : "dark") + }) + + document.getElementById("select-folder").addEventListener("click", () => { + if (interval) clearInterval(interval) + selected = null + + const input = document.createElement("input") + input.type = "file" + input.webkitdirectory = true + input.onchange = e => { + selected = e.target.files + mainScan() + } + if ("showPicker" in HTMLInputElement.prototype) input.showPicker() + else input.click() + }) + document.getElementById("select-zip").addEventListener("click", () => { + if (interval) clearInterval(interval) + + const input = document.createElement("input") + input.type = "file" + input.accept = ".zip" + input.onchange = e => handleZip(e.target.files[0]) + + if ("showPicker" in HTMLInputElement.prototype) input.showPicker() + else input.click() + }) + + document.getElementById("about-button").addEventListener("click", () => { + document.getElementById("aboutDialog").showModal() + }) + for (const elem of document.querySelectorAll("dialog .close")) { + elem.addEventListener("click", () => elem.closest("dialog").close()) + elem.addEventListener("keydown", e => { + if (e.key == "Enter") elem.closest("dialog").close() + }) + } + + for (const elem of document.getElementsByClassName("share")) elem.addEventListener("click", () => share(elem.dataset.type)) + + if (location.protocol == "https:" && "serviceWorker" in navigator) navigator.serviceWorker.register("/serviceworker.js") +}) + +window.addEventListener("dragover", event => { + event.stopPropagation() + event.preventDefault() + event.dataTransfer.dropEffect = "copy" +}) +window.addEventListener("drop", async event => { + event.stopPropagation() + event.preventDefault() + const fileList = event.dataTransfer.files + if (fileList.length == 0) return + + const dropElement = document.createElement("div") + dropElement.id = "drop" + dropElement.style.left = event.clientX + "px" + dropElement.style.top = event.clientY + "px" + document.body.appendChild(dropElement) + dropElement.addEventListener("animationend", () => dropElement.remove()) + + if (fileList[0].name.endsWith(".zip")) handleZip(fileList[0]) + else { + selected = [] + for await (const file of Object.values(fileList)) { + try { + selected.push({ + name: file.name, + content: await file.text() + }) + } catch (e) { + console.error(e) + alert("Couldn't read file: " + file.name + "\nYour browser may not support reading files/folders by dropping them on a website, try using the buttons above.") + } + } + mainScan() + } +}) +window.addEventListener("paste", async event => { + event.preventDefault() + if (event.clipboardData.files.length == 0) { + if (event.clipboardData.items.length > 0) event.clipboardData.items[0].getAsString(str => { + selected = [{name: "clipboard.mcfunction", content: str}] + mainScan() + }) + return + } + + const fileList = event.clipboardData.files + if (fileList[0].name.endsWith(".zip")) handleZip(fileList[0]) + else { + selected = [] + for await (const file of Object.values(fileList)) { + try { + selected.push({ + name: file.name, + content: await file.text() + }) + } catch (e) { + console.error(e) + alert("Couldn't read file: " + file.name + "\nYour browser may not support reading files/folders from the clipboard, try using the buttons above.") + } + } + mainScan() + } +}) diff --git a/assets/style.css b/assets/style.css index ea6add5..e5996ca 100644 --- a/assets/style.css +++ b/assets/style.css @@ -121,54 +121,21 @@ summary { cursor: pointer; } -.dialog { - position: fixed; - display: none; - z-index: 1; - left: 0; - top: 0; - padding-top: 100px; - width: 100%; - height: 100%; - overflow: auto; - background-color: var(--dialog-shadow); - transition: .3s; +dialog { + max-width: 90%; } -.dialog-content { - position: relative; - margin: auto; - width: 75%; - padding: 20px; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - animation-name: animateDialog; - animation-duration: 0.4s; - background-color: var(--dialog-bg); - border-radius: 5px; -} - -@keyframes animateDialog { - from { - width: 0; - opacity: 0; - } - to { - width: 75%; - opacity: 1; - } -} - -.close { +dialog .close { color: #AAA; float: right; font-size: 28px; - font-weight: bold; + font-weight: 700; transition: .2s; -} -.close:hover, .close:focus { - color: black; cursor: pointer; } +dialog .close:hover, dialog .close:focus { + color: #000; +} a:link { color: var(--link); diff --git a/index.html b/index.html index 3454e7e..3e155b3 100644 --- a/index.html +++ b/index.html @@ -56,49 +56,45 @@

-
-
- × -

About

+ + × +

About

-

- Made in HTML, plain JavaScript and CSS, this site allows you to get usage stats from your Minecraft data and resource packs. - It also allows analyzing of whole worlds and shaders. -
- Everything is done locally, no data ever gets sent to any server (except for anonymous Cloudflare statistics). -

+

+ Made in HTML, plain JavaScript and CSS, this site allows you to get usage stats from your Minecraft data and resource packs. + It also allows analyzing of whole worlds and shaders. +
+ Everything is done locally, no data ever gets sent to any server (except for anonymous Cloudflare statistics). +

-

- Developed by: TomatoCake -

-

- Inspired by: ErrorCrafts FunctionAnalyser -

-

- Uses misodes mcmeta to get a list of all Minecraft versions with their respective pack formats. -

-

- GitHub: https://github.com/DEVTomatoCake/Pack-Analyzer -

-

- Support/Feedback: - Vanilla Minigames Discord or - GitHub -

-
-
+

+ Developed by: TomatoCake +

+

+ Inspired by: ErrorCrafts FunctionAnalyser +

+

+ Uses misodes mcmeta to get a list of all Minecraft versions with their respective pack formats. +

+

+ GitHub: https://github.com/DEVTomatoCake/Pack-Analyzer +

+

+ Support/Feedback: + Vanilla Minigames Discord or + GitHub +

+ -
-
- × -

Share the results as link

+ + × +

Share the results as link

- -
-
- QR code for sharing -
-
+ +
+
+ QR code for sharing + diff --git a/minify.js b/minify.js index e79c13d..752f7a4 100644 --- a/minify.js +++ b/minify.js @@ -95,7 +95,7 @@ const minifyFile = async (path, options = {}) => { }) } -async function main() { +const main = async () => { await minifyFile("./assets/script.js") await minifyFile("./assets/jszip.js", { mangle: { diff --git a/package-lock.json b/package-lock.json index 8f868df..0255ae1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "eslint-plugin-html": "^8.1.1", "eslint-plugin-sonarjs": "^1.0.3", "eslint-plugin-unicorn": "^53.0.0", - "globals": "^15.2.0" + "globals": "^15.3.0" } }, "node_modules/@babel/code-frame": { @@ -1051,9 +1051,9 @@ } }, "node_modules/globals": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.2.0.tgz", - "integrity": "sha512-FQ5YwCHZM3nCmtb5FzEWwdUc9K5d3V/w9mzcz8iGD1gC/aOTHc6PouYu0kkKipNJqHAT7m51sqzQjEjIP+cK0A==", + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.3.0.tgz", + "integrity": "sha512-cCdyVjIUVTtX8ZsPkq1oCsOsLmGIswqnjZYMJJTGaNApj1yHtLSymKhwH51ttirREn75z3p4k051clwg7rvNKA==", "dev": true, "engines": { "node": ">=18" diff --git a/package.json b/package.json index 6c4ab12..c84cc9f 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,6 @@ "eslint-plugin-html": "^8.1.1", "eslint-plugin-sonarjs": "^1.0.3", "eslint-plugin-unicorn": "^53.0.0", - "globals": "^15.2.0" + "globals": "^15.3.0" } } diff --git a/vscExtension/icon.png b/vscExtension/icon.png new file mode 100644 index 0000000..67599e5 Binary files /dev/null and b/vscExtension/icon.png differ diff --git a/vscExtension/package-lock.json b/vscExtension/package-lock.json index 20a8ed7..9491c12 100644 --- a/vscExtension/package-lock.json +++ b/vscExtension/package-lock.json @@ -1,12 +1,12 @@ { "name": "pack-analyzer", - "version": "1.0.0", + "version": "1.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pack-analyzer", - "version": "1.0.0", + "version": "1.1.1", "devDependencies": { "@stylistic/eslint-plugin-js": "^2.1.0", "@types/node": "^20.12.12", @@ -17,16 +17,7 @@ "eslint-plugin-unicorn": "^53.0.0" }, "engines": { - "vscode": "^1.88.0" - } - }, - "node_modules/@aashutoshrathi/word-wrap": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", - "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "vscode": "^1.89.0" } }, "node_modules/@azure/abort-controller": { @@ -98,15 +89,15 @@ } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.15.2.tgz", - "integrity": "sha512-BmWfpjc/QXc2ipHOh6LbUzp3ONCaa6xzIssTU0DwH9bbYNXJlGUL6tujx5TrbVd/QQknmS+vlQJGrCq2oL1gZA==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.16.0.tgz", + "integrity": "sha512-CeuTvsXxCUmEuxH5g/aceuSl6w2EugvNHKAtKKVdiX915EjJJxAwfzNNWZreNnbxHZ2fi0zaM6wwS23x2JVqSQ==", "dev": true, "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.4.0", "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.3.0", + "@azure/core-util": "^1.9.0", "@azure/logger": "^1.0.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", @@ -166,9 +157,9 @@ } }, "node_modules/@azure/identity": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.1.0.tgz", - "integrity": "sha512-BhYkF8Xr2gXjyDxocm0pc9RI5J5a1jw8iW0dw6Bx95OGdYbuMyFZrrwNw4eYSqQ2BB6FZOqpJP3vjsAqRcvDhw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.2.0.tgz", + "integrity": "sha512-ve3aYv79qXOJ8wRxQ5jO0eIz2DZ4o0TyME4m4vlGV5YyePddVZ+pFMzusAMODNAflYAAv1cBIhKnd4xytmXyig==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", @@ -203,33 +194,33 @@ } }, "node_modules/@azure/msal-browser": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.13.0.tgz", - "integrity": "sha512-fD906nmJei3yE7la6DZTdUtXKvpwzJURkfsiz9747Icv4pit77cegSm6prJTKLQ1fw4iiZzrrWwxnhMLrTf5gQ==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.14.0.tgz", + "integrity": "sha512-Un85LhOoecJ3HDTS3Uv3UWnXC9/43ZSO+Kc+anSqpZvcEt58SiO/3DuVCAe1A3I5UIBYJNMgTmZPGXQ0MVYrwA==", "dev": true, "dependencies": { - "@azure/msal-common": "14.9.0" + "@azure/msal-common": "14.10.0" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "14.9.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.9.0.tgz", - "integrity": "sha512-yzBPRlWPnTBeixxLNI3BBIgF5/bHpbhoRVuuDBnYjCyWRavaPUsKAHUDYLqpGkBLDciA6TCc6GOxN4/S3WiSxg==", + "version": "14.10.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.10.0.tgz", + "integrity": "sha512-Zk6DPDz7e1wPgLoLgAp0349Yay9RvcjPM5We/ehuenDNsz/t9QEFI7tRoHpp/e47I4p20XE3FiDlhKwAo3utDA==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-node": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.7.0.tgz", - "integrity": "sha512-wXD8LkUvHICeSWZydqg6o8Yvv+grlBEcmLGu+QEI4FcwFendbTEZrlSygnAXXSOCVaGAirWLchca35qrgpO6Jw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.8.1.tgz", + "integrity": "sha512-VcZZM+5VvCWRBTOF7SxMKaxrz+EXjntx2u5AQe7QE06e6FuPJElGBrImgNgCh5QmFaNCfVFO+3qNR7UoFD/Gfw==", "dev": true, "dependencies": { - "@azure/msal-common": "14.9.0", + "@azure/msal-common": "14.10.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" }, @@ -260,12 +251,12 @@ } }, "node_modules/@babel/highlight": { - "version": "7.24.2", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", - "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", + "version": "7.24.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.5.tgz", + "integrity": "sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -289,6 +280,18 @@ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@eslint-community/regexpp": { "version": "4.10.0", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", @@ -429,18 +432,6 @@ "eslint": ">=8.40.0" } }, - "node_modules/@stylistic/eslint-plugin-js/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/@types/eslint": { "version": "8.56.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", @@ -784,9 +775,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001617", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001617.tgz", - "integrity": "sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA==", + "version": "1.0.30001620", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz", + "integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==", "dev": true, "funding": [ { @@ -817,15 +808,6 @@ "node": ">=4" } }, - "node_modules/chalk/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/cheerio": { "version": "1.0.0-rc.12", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", @@ -898,19 +880,10 @@ "node": ">=4" } }, - "node_modules/clean-regexp/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/cockatiel": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cockatiel/-/cockatiel-3.1.2.tgz", - "integrity": "sha512-5yARKww0dWyWg2/3xZeXgoxjHLwpVqFptj9Zy7qioJ6+/L0ARM184sgMUrQDjxw7ePJWlGhV998mKhzrxT0/Kg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/cockatiel/-/cockatiel-3.1.3.tgz", + "integrity": "sha512-xC759TpZ69d7HhfDp8m2WkRwEUiCkxY8Ee2OQH/3H6zmy2D/5Sm+zSTbPRa+V2QyjDtpMvjOIAOVjA2gp6N1kQ==", "dev": true, "engines": { "node": ">=16" @@ -959,9 +932,9 @@ "dev": true }, "node_modules/core-js-compat": { - "version": "3.37.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.0.tgz", - "integrity": "sha512-vYq4L+T8aS5UuFg4UwDhc7YNRWVeVZwltad9C/jV3R2LgVOpS9BDr7l/WL6BN0dbV3k1XejPTHqqEzJgsa0frA==", + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", "dev": true, "dependencies": { "browserslist": "^4.23.0" @@ -1172,9 +1145,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.763", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.763.tgz", - "integrity": "sha512-k4J8NrtJ9QrvHLRo8Q18OncqBCB7tIUyqxRcJnlonQ0ioHKYB988GcDFF3ZePmnb8eHEopDs/wPHR/iGAFgoUQ==", + "version": "1.4.774", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.774.tgz", + "integrity": "sha512-132O1XCd7zcTkzS3FgkAzKmnBuNJjK8WjcTtNuoylj7MYbqw5eXehjQ5OK91g0zm7OTKIPeaAG4CPoRfD9M1Mg==", "dev": true }, "node_modules/end-of-stream": { @@ -1239,15 +1212,12 @@ } }, "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.8.0" } }, "node_modules/eslint": { @@ -1363,12 +1333,12 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1423,16 +1393,16 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { + "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=10" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/has-flag": { @@ -1473,18 +1443,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", - "dev": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -2442,9 +2400,9 @@ "dev": true }, "node_modules/node-abi": { - "version": "3.57.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.57.0.tgz", - "integrity": "sha512-Dp+A9JWxRaKuHP35H77I4kCKesDy5HUDEmScia2FyncMTOXASMyg251F5PhFoDA5uqBrDDffiLpbqnrZmNXW+g==", + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", + "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==", "dev": true, "optional": true, "dependencies": { @@ -2542,17 +2500,17 @@ } }, "node_modules/optionator": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", - "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "dependencies": { - "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0" + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -2710,9 +2668,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/pluralize": { @@ -2937,15 +2895,6 @@ "node": ">=8" } }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/read-pkg/node_modules/type-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", @@ -3397,6 +3346,15 @@ "node": ">= 0.8.0" } }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/typed-rest-client": { "version": "1.8.11", "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", @@ -3427,9 +3385,9 @@ "dev": true }, "node_modules/update-browserslist-db": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.15.tgz", - "integrity": "sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==", + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", "dev": true, "funding": [ { @@ -3447,7 +3405,7 @@ ], "dependencies": { "escalade": "^3.1.2", - "picocolors": "^1.0.0" + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" @@ -3512,6 +3470,15 @@ "node": ">= 8" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/vscExtension/package.json b/vscExtension/package.json index c91a2f0..03259e3 100644 --- a/vscExtension/package.json +++ b/vscExtension/package.json @@ -2,7 +2,7 @@ "name": "pack-analyzer", "displayName": "Minecraft Data and Resource pack Analyzer", "description": "Allows you to analyze and generate stats for [Minecraft](https://minecraft.net) Java Edition data and resource packs.", - "version": "1.1.0", + "version": "1.1.1", "publisher": "tomatocake", "main": "./out/extension", "browser": "./out/extension", @@ -50,7 +50,7 @@ { "id": "packAnalyzer", "title": "Pack Analyzer", - "icon": "temp_icon.png" + "icon": "icon.png" } ] }, diff --git a/vscExtension/src/extension.js b/vscExtension/src/extension.js index 5209229..b96a7b6 100644 --- a/vscExtension/src/extension.js +++ b/vscExtension/src/extension.js @@ -50,8 +50,11 @@ let dpExclusive = { datapacks: 0, dimension: 0, dimension_type: 0, + enchantment: 0, + enchantment_provider: 0, item_modifiers: 0, loot_tables: 0, + painting_variant: 0, predicates: 0, recipes: 0, structures: 0, @@ -101,6 +104,7 @@ let rpExclusive = { lang: 0, models: 0, particles: 0, + resourcepacks: 0, shaders: 0, sounds: 0, texts: 0, @@ -110,7 +114,7 @@ let rpExclusive = { const localize = str => str.toLocaleString() /* processFile */ -async function processEntries(entries) { +const processEntries = async entries => { for await (const filePath of entries) { const name = filePath.split("/").pop() @@ -122,11 +126,25 @@ async function processEntries(entries) { } log("Successfully processed " + done + " files with " + error + " errors") + + /*log(await vscode.commands.executeCommand("editor.actions.findWithArgs", { + searchString: "@a", + matchWholeWord: true, + isCaseSensitive: true + })) + log("Search for @a executed")*/ + + log(await vscode.commands.executeCommand("workbench.action.findInFiles", { + searchString: "@a", + matchWholeWord: true, + isCaseSensitive: true + })) + log("Search 2 for @a executed") } -async function mainScan() { +const mainScan = async () => { let html = - (packFiles.length > 0 ? "" + (rpMode ? "Resource" : "Data") + "pack" + (packFiles.length == 1 ? "" : "s") + " found:
" + + (packFiles.length > 0 ? "" + (rpMode ? "Resource" : "Data") + " pack" + (packFiles.length == 1 ? "" : "s") + " found:
" + packFiles.map(pack => { let oldestFormat = pack.pack.pack_format let newestFormat = pack.pack.pack_format @@ -163,40 +181,20 @@ async function mainScan() { : "") + (packFiles.length == 0 && (filetypes.fsh || filetypes.vsh || filetypes.xcf || filetypes.glsl) ? "Shader found
" : "") + - "Pack file types found:
" + - Object.keys(filetypes).sort((a, b) => filetypes[b] - filetypes[a]).map(type => "." + type + ": " + localize(filetypes[type]) + "
").join("") + (Object.keys(filetypesOther).length > 0 ? "
" + "Non-pack file types found:" + Object.keys(filetypesOther).sort((a, b) => filetypesOther[b] - filetypesOther[a]).map(type => "" + type + ": " + localize(filetypesOther[type]) + "
").join("") + "

" : "") + - (emptyFiles.length > 0 ? - "Empty files:
" + - emptyFiles.map(func => "" + func + "
").join("") + - "
" - : "") + - (dpExclusive.scoreboards > 0 ? "Scoreboards created: " + localize(dpExclusive.scoreboards) + "
" : "") + - (!rpMode && Object.values(dpExclusive.selectors).reduce((a, b) => a + b) != 0 ? "Selectors used:
" : "") + - Object.keys(dpExclusive.selectors).filter(i => dpExclusive.selectors[i] > 0).sort((a, b) => dpExclusive.selectors[b] - dpExclusive.selectors[a]) - .map(type => "@" + type + ": " + localize(dpExclusive.selectors[type]) + "
").join("") + (!rpMode && Object.values(dpExclusive.folders).reduce((a, b) => a + b) != 0 ? "Data pack features used:
" : "") + Object.keys(dpExclusive.folders).filter(i => dpExclusive.folders[i] > 0).sort((a, b) => dpExclusive.folders[b] - dpExclusive.folders[a]) - .map(type => "" + type + ": " + localize(dpExclusive.folders[type]) + "
").join("") + - (!rpMode && Object.values(dpExclusive.tags).reduce((a, b) => a + b) != 0 ? "Tags used:
" : "") + - Object.keys(dpExclusive.tags).filter(i => dpExclusive.tags[i] > 0).sort((a, b) => dpExclusive.tags[b] - dpExclusive.tags[a]) - .map(type => "" + type + ": " + localize(dpExclusive.tags[type]) + "
").join("") + - - (rpMode && Object.values(rpExclusive).reduce((a, b) => a + b) != 0 ? "
Resource pack features used:
" : "") + - Object.keys(rpExclusive).filter(i => rpExclusive[i] > 0).sort((a, b) => rpExclusive[b] - rpExclusive[a]) - .map(type => "" + type + ": " + localize(rpExclusive[type]) + "
").join("") + .map(type => "" + type + ": " + localize(dpExclusive.folders[type]) + "
").join("") commands = Object.fromEntries(Object.entries(commands).sort(([, a], [, b]) => b - a)) Object.keys(commands).forEach(cmd => { html += cmd + ": " + localize(commands[cmd]) + "
" - if (cmdsBehindExecute[cmd]) html += "Behind execute: " + localize(cmdsBehindExecute[cmd]) + - (cmd == "execute" ? "⚠️ (... run execute ... equals ... ...)" : "") + "
" if (cmdsBehindMacros[cmd]) html += "Behind macro: " + localize(cmdsBehindMacros[cmd]) + "
" if (cmdsBehindReturn[cmd]) html += "Behind return: " + localize(cmdsBehindReturn[cmd]) + "
" }) @@ -269,8 +267,11 @@ class PackAnalyzer { datapacks: 0, dimension: 0, dimension_type: 0, + enchantment: 0, + enchantment_provider: 0, item_modifiers: 0, loot_tables: 0, + painting_variant: 0, predicates: 0, recipes: 0, structures: 0, @@ -320,6 +321,7 @@ class PackAnalyzer { lang: 0, models: 0, particles: 0, + resourcepacks: 0, shaders: 0, sounds: 0, texts: 0, @@ -375,6 +377,15 @@ class PackAnalyzer { } else if (element.parent == "selectors") { treeItem.label = "@" + element.item + ": " + localize(dpExclusive.selectors[element.item]) treeItem.iconPath = iconUrl("{DPICON|mcfunction}") + treeItem.command = { + command: "editor.actions.findWithArgs", + title: "Find", + arguments: [{ + searchString: "@" + element.item, + matchWholeWord: true, + isCaseSensitive: true + }] + } } else if (element.item == "rpExclusive") { treeItem.label = "Resource pack" treeItem.iconPath = iconUrl("{DPICON|assets}") diff --git a/vscExtension/temp_icon.png b/vscExtension/temp_icon.png deleted file mode 100644 index d25ec03..0000000 Binary files a/vscExtension/temp_icon.png and /dev/null differ