From f4eae3baf16eaac0cc795fdc687d01969604c478 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Wed, 2 Oct 2024 16:18:34 +0800 Subject: [PATCH] attempt to fix arrays 1 --- postinit.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/postinit.js b/postinit.js index 2e9eec5..b01ae95 100644 --- a/postinit.js +++ b/postinit.js @@ -147,7 +147,7 @@ globalThis.modapi_postinit = "(" + (() => { return xOut; } } - return outputValue; + return null; } ModAPI.array.object = function (jclass, size) { if (Array.isArray(size)) { @@ -311,16 +311,17 @@ globalThis.modapi_postinit = "(" + (() => { var reloadDeprecationWarnings = 0; const TeaVMArray_To_Recursive_BaseData_ProxyConf = { get(target, prop, receiver) { - var outputValue = Reflect.get(target, prop, receiver); - if (outputValue && typeof outputValue === "object" && !Array.isArray(outputValue)) { - return ModAPI.util.wrap(outputValue, target, this._corrective); - } if (prop === "getRef") { return function () { return target; } } - return ModAPI.util.wrap(outputValue, target, this._corrective); + var outputValue = Reflect.get(target, prop, receiver); + var wrapped = ModAPI.util.wrap(outputValue, target, this._corrective); + if (wrapped) { + return wrapped; + } + return outputValue; }, set(object, prop, value) { object[prop] = value;