mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-23 06:01:38 -09:00
commit
c4cae469c6
10
cli.js
10
cli.js
@ -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")) {
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user