CraftTweaker ICEs (!?) when compiling a script
jagh201 opened this issue ยท 3 comments
Issue Description:
I installed minecraft(1.12.2) with latest CraftTweaker, GregTech and Shadows of Greg that are available on twitch launcher. Other than that, i have no mods except for their dependencies.
What happens:
I'm trying to compile and run a script that would dump all available recipemaps and their recipes to crafttweaker.log. Instead of getting some output or a compile error if there is any, i seem to get an exception originating in the compiler itself. See pastebins of crafttweaker.log and my script file for details
What you expected to happen:
Either script output or some compile/run time error originating in my script.
Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):
crafttweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):
Affected Versions (Do not use "latest"):
- Minecraft: 1.12.2
- Forge: forge-14.23.5.2847
- Crafttweaker: CraftTweaker2-1.12-4.1.19.jar
- Using a server: no
- If yes, does the client have the exact same scripts?
Your most recent log file where the issue was present:
having experimented a bit, it seems to me that CraftTweaker has difficulties dealing with List<?>
types, like List<IItemStack>
that the getter aRecipe.outputs
generates. I don't know if i can even specify the type template like List<> in ZenScript. The only method i found to convert List<?> to an array seems to be with a for-loop:
var outputArray as IItemStack[] = [];
for anItemStack in aRecipe.outputs {
outputArray += anItemStack;
}
as a simple list.toArray()
or even list.toArray([] as IItemStack[])
don't work either.
Hm... it should not have any issue as long as the type is actually known and not a generic constraint like
public List<T> getXYZ()
IIngredient#getItems returns a List as well.
Also, to answer your question
[] as IItemStack[]; //Java Type: IItemStack[]
[] as [IItemStack]; //Java Type: List<IItemStack>