diff --git a/core/core.js b/core/core.js index 1e499d5..6b6f292 100644 --- a/core/core.js +++ b/core/core.js @@ -368,8 +368,12 @@ var main;(function(){` if (EFIConfig.doMinify) { _status("Shrinking file..."); await wait(50); - - patchedFile = await minify(patchedFile, parser, EFIConfig); + if (globalThis.process) { + 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, conf: EFIConfig } -} \ No newline at end of file +} diff --git a/examplemods/AsyncSink.js b/examplemods/AsyncSink.js index 78b0b2e..fe7153d 100644 --- a/examplemods/AsyncSink.js +++ b/examplemods/AsyncSink.js @@ -7,7 +7,14 @@ ModAPI.meta.credits("By ZXMushroom63"); const ResourceLocation = ModAPI.reflect.getClassByName("ResourceLocation").constructors.find(x => x.length === 1); //AsyncSink is a plugin to debug and override asynchronous methods in EaglercraftX 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 unwrap = ModAPI.hooks.methods.otji_JSWrapper_unwrap; function getAsyncHandlerName(name) { @@ -401,4 +408,4 @@ ModAPI.meta.credits("By ZXMushroom63"); return soundPool; } } -})(); \ No newline at end of file +})();