Merge pull request #117 from eaglerforge/main

v2.7.94: small fixes
This commit is contained in:
ZXMushroom63 2025-06-28 13:07:11 +08:00 committed by GitHub
commit c4cae469c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 6 deletions

10
cli.js
View File

@ -33,7 +33,15 @@ async function main() {
EFI.conf.doMinifyPlus = args.includes("/minify_extras");
EFI.conf.verbose = args.includes("/verbose");
const string = await fs.readFile(inputFile, {encoding: 'utf-8'});
const res = await EFI.patchClient(string, new DOMParser());
const bannedEscapeCodes = { //babel added support for every newline escape code in existence. browser javascript code can process these unescaped, but babel-cli can't
"\u2028": "\\u2028",
"\u0085": "\\u0085",
"\u2029": "\\u2029",
}
const res = await EFI.patchClient(
Object.entries(bannedEscapeCodes).reduce((acc, ent)=>acc.replaceAll(ent[0], ent[1]), string),
new DOMParser()
);
if (res) {
var output = args[1];
if (!output || !output.endsWith(".html")) {

View File

@ -37,7 +37,7 @@ var modapi_preinit = `globalThis.ModAPI ||= {};
`;
var freezeCallstack = `if(ModAPI.hooks.freezeCallstack){return false};`;
const EFIConfig = {
ModAPIVersion: "v2.7.93", //also change in package.json
ModAPIVersion: "v2.7.94", //also change in package.json
doEaglerforge: true,
verbose: false,
doServerExtras: false,

View File

@ -351,12 +351,12 @@ const modapi_postinit = "(" + (() => {
return ModAPI.hooks._teavm.$rt_createDoubleArray(size);
}
//Proxy to make sure static variables are initialized before access.
//Proxy to make sure static variables are initialized before access, as well as fixing some issues in 1.12
function makeClinitProxy(staticVariables, clinit) {
return new Proxy(staticVariables, {
get: function (a, b, c) {
clinit();
return Reflect.get(a, b, c);
return Reflect.get(a, b, c) || Reflect.get(a, b.toUpperCase(), c);
}
});
}
@ -675,7 +675,6 @@ const modapi_postinit = "(" + (() => {
get(target, prop, receiver) {
var outProp = prop;
var outputValue = Reflect.get(target, outProp, receiver);
outputValue ||= Reflect.get(target, outProp.toUpperCase(), receiver); //1.12 made a lot of variables uppercase (idk why)
if (outputValue && typeof outputValue === "object" && Array.isArray(outputValue.data) && typeof outputValue.type === "function") {
return new Proxy(outputValue.data, TeaVMArray_To_Recursive_BaseData_ProxyConf);
}

View File

@ -1,6 +1,6 @@
{
"name": "eaglerforgeinjector",
"version": "2.7.93",
"version": "2.7.94",
"description": "Advanced modding API injector for unminified, unobfuscated, unsigned eaglercraft builds.",
"main": "node.js",
"directories": {