From e02d7f225fdc98e8f1c13d4f6392aa2967535b6a Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sat, 28 Jun 2025 13:06:07 +0800 Subject: [PATCH] move uppercase reflect location --- core/postinit.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/postinit.js b/core/postinit.js index e6ae7e6..bde3869 100644 --- a/core/postinit.js +++ b/core/postinit.js @@ -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); }