CraftTweaker

CraftTweaker

151M Downloads

Truncated class file

GMengZhi opened this issue ยท 7 comments

commented

Intro:

Please note, you will be treated exactly like any other person who submits a bug report, saying this, if you decide to delete this template entirely, your issue will be closed. If you do not provide relevant information when reporting an issue (for example having a script issue and not providing the scripts or the crafttweaker.log file) this issue will be closed. you may now delete this section and continue on with the report.

Issue Description:

Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If you are using an unnofficial version of Minetweaker or Crafttweaker please report it to the person who gave you the version. Also please look at the other issues to make sure that you are not creating a duplicate.

What happens:

The script can be compiled, but there will be a "Truncated class file" error after restarting the game, and part of the truncated script does not take effect

What you expected to happen:

Script errors with Truncated class file

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

https://gist.github.com/GMengZhi-Github/fcab711ca1df2d3a5d56f038a41c910c
https://gist.github.com/GMengZhi-Github/541b04e84a7f3ad7cdc21d71edd158d9

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:14.23.5.2847
  • Crafttweaker: 4.1.20.562

Your most recent log file where the issue was present:

https://gist.github.com/GMengZhi-Github/880fb6a774ca9faab6728b5390449ff8

commented

Okay so several things:

  1. Update to the latest beta version on CF, that most likely deals with your captured expressions.
  2. Just to be sure, add as IItemStack[] to all of your IItemStack arrays.
  3. If the problem still persists, try splitting your script into multiple parts to find out where exactly it errors.
commented

Okay I checked The problem lies in the cyclic deletion of recipes

commented

Just like :

var UU = [<ic2:te:61>,<ic2:te:62>,<ic2:te:63>,<ic2:te:64>] as IItemStack[] ;
for i, UU_machine in UU {
    var UU_machine = UU[i];
    recipes.remove(UU_machine);
}

and ``import crafttweaker.item.IItemStack as IItemStack;

commented

image
why?

commented

firstly NEVER post screenshots of errors -_-

secondly make sure you are importing IItemStack correctly at the top of your script

commented

Is that still an issue?

commented

Closing after many months without an update.