lets see if mr chad gbd can halp

This commit is contained in:
sq 2024-09-22 19:58:46 +08:00 committed by GitHub
parent 89bab82944
commit ca73a82f60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 6 deletions

View File

@ -13,6 +13,7 @@ for (let elementName in elements) {
runAfterLoad(function() { runAfterLoad(function() {
let modDescriptions = {}; let modDescriptions = {};
let vanillaElements = Object.keys(elements);
let fetchPromises = enabledMods.map(mod => { let fetchPromises = enabledMods.map(mod => {
return fetch(mod) return fetch(mod)
@ -27,8 +28,9 @@ runAfterLoad(function() {
Promise.all(fetchPromises).then(() => { Promise.all(fetchPromises).then(() => {
Object.keys(elements).forEach(function(elementName) { Object.keys(elements).forEach(function(elementName) {
let element = elements[elementName]; let element = elements[elementName];
let elementMod = "Sandboxels (Vanilla)"; let elementMod = vanillaElements.includes(elementName) ? "Sandboxels (Vanilla)" : null;
if (!elementMod) {
for (let mod of enabledMods) { for (let mod of enabledMods) {
if (modDescriptions[mod].includes(`elements.${elementName} =`) || if (modDescriptions[mod].includes(`elements.${elementName} =`) ||
modDescriptions[mod].includes(`elements["${elementName}"] =`)) { modDescriptions[mod].includes(`elements["${elementName}"] =`)) {
@ -36,6 +38,9 @@ runAfterLoad(function() {
break; break;
} }
} }
}
if (!elementMod) elementMod = "Unknown Mod";
if (element.desc && typeof element.desc === 'string' && element.desc.trim() !== '') { if (element.desc && typeof element.desc === 'string' && element.desc.trim() !== '') {
if (!element.desc.includes("This Element is from")) { if (!element.desc.includes("This Element is from")) {