Can't call custom method from lambda
luoluo39 opened this issue ยท 3 comments
Intro:
Issue Description:
java.lang.IllegalAccessError was thrown when call an custom method from lambda.
What happens:
java.lang.IllegalAccessError was thrown.
What you expected to happen:
script run successfully.
Script used:
function add(a as int, b as int) as int {
return a + b;
}
var someLambda as function() as int = () => { return add(1, 1); };
someLambda();
crafttweaker.log file:
Environment:
- Minecraft Version: 1.16.5
- Forge Version: 36.0.42
- CraftTweaker Version: 1.16.5-7.1.0.129
- Are you using a server: no
Game log:
You can find some ZC docs (they are still work in progress) here
https://docs.blamejared.com/1.18/en/zencode/ZenCode
and built in types here:
https://github.com/ZenCodeLang/StdLibs/tree/a0e740f003f6f246f0844fbe8f12edc6f974cf5e/src/main/zencode/stdlib/src
add public
before function
.
public function add(a as int, b as int) as int {
return a + b;
}