mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-25 07:01:20 -09:00
fix stupid bug
This commit is contained in:
parent
b67cb8ec3a
commit
cdd427ed20
@ -63,7 +63,11 @@ globalThis.modapi_modloader = "(" + (() => {
|
|||||||
|
|
||||||
globalThis.addFileMod = async function addFileMod(mod, textContents) {
|
globalThis.addFileMod = async function addFileMod(mod, textContents) {
|
||||||
const mods = await getMods();
|
const mods = await getMods();
|
||||||
|
if (mods.includes(mod)) {
|
||||||
|
await removeMod(mods.indexOf(mod));
|
||||||
|
} else {
|
||||||
mods.push(mod);
|
mods.push(mod);
|
||||||
|
}
|
||||||
await saveMods(mods);
|
await saveMods(mods);
|
||||||
|
|
||||||
const db = await getDatabase();
|
const db = await getDatabase();
|
||||||
|
@ -265,7 +265,11 @@ globalThis.modapi_postinit = "(" + (() => {
|
|||||||
"class": item || null,
|
"class": item || null,
|
||||||
"hasMeta": !!item,
|
"hasMeta": !!item,
|
||||||
"instanceOf": function (object) {
|
"instanceOf": function (object) {
|
||||||
|
try {
|
||||||
return ModAPI.hooks._teavm.$rt_isInstance(object, item || null);
|
return ModAPI.hooks._teavm.$rt_isInstance(object, item || null);
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"compiledName": compiledName
|
"compiledName": compiledName
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user