From 7a2fce5f6cf823f7f663506e664c99ca7d3b7ba7 Mon Sep 17 00:00:00 2001 From: ZXMushroom63 <116805577+ZXMushroom63@users.noreply.github.com> Date: Sun, 20 Apr 2025 12:29:18 +0800 Subject: [PATCH] Allow usage of ID instead of raw class --- core/postinit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/postinit.js b/core/postinit.js index 05bc5aa..2673d2d 100644 --- a/core/postinit.js +++ b/core/postinit.js @@ -285,6 +285,9 @@ const modapi_postinit = "(" + (() => { return null; } ModAPI.array.object = function (jclass, size) { + if (typeof jclass = "string") { + jclass = ModAPI.reflect.getClassById(jclass).class; + } if (Array.isArray(size)) { return ModAPI.hooks._teavm.$rt_createArrayFromData(jclass, size); }