prototype stack changes

This commit is contained in:
ZXMushroom63 2025-01-25 17:48:01 +08:00
parent 9555af5b1a
commit bbed8f1f42
2 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ Methods:
- When called without a filter function, the filter defaults to `(fn)=>fn.length === 1`
- `ModAPI.reflect.prototypeStack(rClass: ReflectClass, target: Class/ConstructorFunction) : void`
- Copies methods from a reflect class and it's parents onto a target native JavaScript class. This allows TeaVM to use these objects normally, without you having to manually reimplement every method. In other words, this is the equivalent of extending a class.
- Also adds some metadata to make the class work with `ModAPI.util.asClass`
- [Example usage](https://github.com/eaglerforge/EaglerForgeInjector/blob/6e8598c180f96a65c0c101be72e6d0fa53195404/examplemods/unlucky_blocks.js#L37)
### ReflectClass Definition

View File

@ -429,6 +429,7 @@ globalThis.modapi_postinit = "(" + (() => {
item: null,
supertypes: [reflectClass.class]
};
classFn.classObject = null;
}
var reloadDeprecationWarnings = 0;