CraftTweaker

CraftTweaker

151M Downloads

Can't call custom method from lambda

luoluo39 opened this issue ยท 3 comments

commented

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:

https://pastebin.com/zu9HKK0N


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:

https://pastebin.com/sTg1uMHw

commented

add public before function.

public function add(a as int, b as int) as int {
	return a + b;
}
commented

add public before function.

public function add(a as int, b as int) as int {
	return a + b;
}

that's a little embarrassing. I'm wonder if there are more document about zenScript itself and built-in types like stdlib.list?