Cannot use instances of java interfaces created in js
MattiDragon opened this issue ยท 0 comments
Minecraft Version
1.18.2
KubeJS Version
1802.5.1-build.363
Rhino Version
1801.1.9-build.135
Architectury Version
4.1.36
Forge/Fabric Version
Fabric Loader 0.13.3
Describe your issue
If you create and instance of a interface in js like it had constructor creates a java object implementing interface. If you then try calling any of the interfaces abstract methods that you implemented it will throw a NoSuchMethodError
.
Example code (any script):
const predicate = java("java.util.function.Predicate")((value) => {
console.log(value);
return true;
})
predicate.test("hello")