Add simple noreflect wrapper fn generator

This commit is contained in:
ZXMushroom63 2024-06-12 15:36:57 +08:00
parent 00d08e11f4
commit 51112a09ed
1 changed files with 4 additions and 0 deletions

View File

@ -74,10 +74,14 @@ import org.teavm.jso.JSFunctor;
//Made by ZXMushroom63
public class PLReflect extends ModData {
@JSBody(params = { "reflectInst" }, script = "reflectInst.getMethodMapFromClass = function(classObj) {var outMethodMap = {}; classObj.methods.forEach(method=>{outMethodMap[method.methodName]=method;}); return outMethodMap;}")
public static native BaseData setMethodMapFn(BaseData reflectInst);
%classdefs%
public static PLReflect makeModData() {
PLReflect plReflectGlobal = new PLReflect();
setMethodMapFn(plReflectGlobal);
ArrayList<BaseData> reflectProfiles = new ArrayList<BaseData>();
%classdefcalls%