Merge pull request #91 from happylabdab2/main

Update core.js
This commit is contained in:
ZXMushroom63 2025-04-27 14:11:04 +08:00 committed by GitHub
commit 614d062d3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 5 deletions

View File

@ -368,8 +368,12 @@ var main;(function(){`
if (EFIConfig.doMinify) { if (EFIConfig.doMinify) {
_status("Shrinking file..."); _status("Shrinking file...");
await wait(50); await wait(50);
if (globalThis.process) {
patchedFile = await minify(patchedFile, parser, EFIConfig); let _minify = require("./minify").minify;
patchedFile = await _minify(patchedFile, parser, EFIConfig);
} else {
patchedFile = await minify(patchedFile, parser, EFIConfig);
}
} }
@ -436,4 +440,4 @@ if (globalThis.process) {
patchClient: patchClient, patchClient: patchClient,
conf: EFIConfig conf: EFIConfig
} }
} }

View File

@ -7,7 +7,14 @@ ModAPI.meta.credits("By ZXMushroom63");
const ResourceLocation = ModAPI.reflect.getClassByName("ResourceLocation").constructors.find(x => x.length === 1); const ResourceLocation = ModAPI.reflect.getClassByName("ResourceLocation").constructors.find(x => x.length === 1);
//AsyncSink is a plugin to debug and override asynchronous methods in EaglercraftX //AsyncSink is a plugin to debug and override asynchronous methods in EaglercraftX
async function runtimeComponent() { async function runtimeComponent() {
const booleanResult = (b) => ModAPI.hooks.methods.nlevit_BooleanResult__new(b * 1); let booleanResult;
if (ModAPI.is_1_12) {
booleanResult = (b) => ModAPI.reflect.getClassById("net.lax1dude.eaglercraft.internal.teavm.BooleanResult").constructors[0](b*1);
} else {
booleanResult = (b) => ModAPI.hooks.methods.nlevit_BooleanResult__new(b * 1);
}
const wrap = ModAPI.hooks.methods.otji_JSWrapper_wrap; const wrap = ModAPI.hooks.methods.otji_JSWrapper_wrap;
const unwrap = ModAPI.hooks.methods.otji_JSWrapper_unwrap; const unwrap = ModAPI.hooks.methods.otji_JSWrapper_unwrap;
function getAsyncHandlerName(name) { function getAsyncHandlerName(name) {
@ -401,4 +408,4 @@ ModAPI.meta.credits("By ZXMushroom63");
return soundPool; return soundPool;
} }
} }
})(); })();