mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-23 06:01:38 -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) {
|
||||
const mods = await getMods();
|
||||
mods.push(mod);
|
||||
if (mods.includes(mod)) {
|
||||
await removeMod(mods.indexOf(mod));
|
||||
} else {
|
||||
mods.push(mod);
|
||||
}
|
||||
await saveMods(mods);
|
||||
|
||||
const db = await getDatabase();
|
||||
|
@ -265,7 +265,11 @@ globalThis.modapi_postinit = "(" + (() => {
|
||||
"class": item || null,
|
||||
"hasMeta": !!item,
|
||||
"instanceOf": function (object) {
|
||||
return ModAPI.hooks._teavm.$rt_isInstance(object, item || null);
|
||||
try {
|
||||
return ModAPI.hooks._teavm.$rt_isInstance(object, item || null);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
"compiledName": compiledName
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user