mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-21 05:01:20 -09:00
small change to static key processing
This commit is contained in:
parent
645970a98b
commit
6b6b7db2b1
@ -351,12 +351,16 @@ const modapi_postinit = "(" + (() => {
|
|||||||
return ModAPI.hooks._teavm.$rt_createDoubleArray(size);
|
return ModAPI.hooks._teavm.$rt_createDoubleArray(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function staticKeyMapper(k) {
|
||||||
|
return k.split(/(?=[A-Z])/).map(x=>x.toUpperCase()).join("_");
|
||||||
|
}
|
||||||
|
|
||||||
//Proxy to make sure static variables are initialized before access, as well as fixing some issues in 1.12
|
//Proxy to make sure static variables are initialized before access, as well as fixing some issues in 1.12
|
||||||
function makeClinitProxy(staticVariables, clinit) {
|
function makeClinitProxy(staticVariables, clinit) {
|
||||||
return new Proxy(staticVariables, {
|
return new Proxy(staticVariables, {
|
||||||
get: function (a, b, c) {
|
get: function (a, b, c) {
|
||||||
clinit();
|
clinit();
|
||||||
return Reflect.get(a, b, c) || Reflect.get(a, b.toUpperCase(), c);
|
return Reflect.get(a, b, c) || Reflect.get(a, staticKeyMapper(b), c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eaglerforgeinjector",
|
"name": "eaglerforgeinjector",
|
||||||
"version": "2.7.94",
|
"version": "2.7.94b",
|
||||||
"description": "Advanced modding API injector for unminified, unobfuscated, unsigned eaglercraft builds.",
|
"description": "Advanced modding API injector for unminified, unobfuscated, unsigned eaglercraft builds.",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user