Allow usage of ID instead of raw class

This commit is contained in:
ZXMushroom63 2025-04-20 12:29:18 +08:00 committed by GitHub
parent 6c0cac16c7
commit 7a2fce5f6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}