CraftTweaker

CraftTweaker

151M Downloads

Truncated Class FIle for scripts using arrays

QuantumBlink1337 opened this issue ยท 6 comments

commented

Issue Description:

I'm trying out arrays for fixing up some of my old scripts. Both of my scripts I'm using pass /ct syntax, but fail due to the truncated error.

What happens:

Script does not load properly due to a truncated class error.

What you expected to happen:

Script to load properly with recipes.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://hastebin.com/afiheyipis.xml Random Things Changes.zs
https://hastebin.com/ciqocemebo.coffeescript Immersive Engineering.zs

(both scripts have the same problem)

crafttweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

https://hastebin.com/fanizabuya.md


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12
  • Forge: 14.24.5.2847
  • Crafttweaker: 4.1.19
  • Using a server: No
  • If yes, does the client have the exact same scripts?

Your most recent log file where the issue was present:

[pastebin/gist/etc link here]

I've tried to cast everything as OreDictEntry[] and IItemStack[] respectively, but to no avail. Is there a fifth package I need to import?

commented

This is one of the cases where it's easier for me if you upload the generated class files.

To do that, please add #debug to both of your scripts and restart the game.
Alaternatively you can run /ct syntax debug.

This will create a folder named classes in your minecraft directory (the same directory where you can also find the scripts and mods folders).
Find the files with the same name as your scripts and upload them here, please.
They will be .class files so you cannot use pastebin or similar.

Those files contain what the script was compiled to and therefore make it easier for me to see the where the issue occured.

commented

I tried adding #debug to the top of my scripts, and I restarted my client and ran /ct syntax debug, but neither genned a classes directory. Funnily enough, the immersive engineering script worked fine on a second restart.

commented

MaterialArray's last entry is an IItemStack, so ZS cannot determine it's type for the randomThings one.
IF everyone was intended to be an IOreDictEntry your last entry is wrong, otherwise you will need to cast it as IIngredient (and import IIngredient as well)

commented

Ah okay. I'll give it a try!

commented

That worked out! Thank you!