[Bug?] "Method code too large!" Error after changing a file to use global variables
justinrusso opened this issue ยท 6 comments
Intro:
Error executing {[0:crafttweaker]: stage3.recipes.add.shaped.zs}: Method code too large!
Issue Description:
After changing scripts to use the globals I created, I got this error.
What happens:
Error executing {[0:crafttweaker]: stage3.recipes.add.shaped.zs}: Method code too large!
Script used:
There is 50+ scripts in total. This is whats truly related (I suppose)
https://gist.github.com/justinrusso/5da32c4556fbcfcf0d14e133e43f637b
See https://github.com/Darkosto/SevTechAgesConfigs/tree/ingot-stuff/scripts if you want the full thing. Commit https://github.com/Darkosto/SevTechAgesConfigs/commit/26d32b0bbcbdbb5aa116527866d6ccf1cfee3c5b broke it.
Minetweaker.log file:
https://gist.github.com/justinrusso/98b4328b3b1a664102cba6469e7e74f7
Affected Versions (Do not use "latest"):
- Minecraft: 1.12.2
- Forge: 14.23.0.2544
- Crafttweaker: 1.12-4.0.10 Latest Dev Build (from kindlich)
Your most recent log file where the issue was present:
Could you test if that script is working if you replace your global maps with values?
I believe your maps might be too big for ZS...
I've got recipe maps (IIngredient[][][][IItemStack]) that are pretty large that seem to do fine, but I'll give it a shot.
I kept the metal and metalItems global maps, and just re-added some old global variables the stage3.recipes.add.shaped.zs file used to use. Reverting back to when that file was not using the global map does not give me the error. I still have it in other files that reference that map, though.
https://gist.github.com/justinrusso/77b123751b4ea59c32ccebd3e7922740
I'm... not sure its me...
I altered the stage3.recipes.add.shaped.zs to make local variables that reference the global map
var ip = metals.iron.plate;
var ap = metals.aluminum.plate;
var lp = metals.lead.plate;
var np = metals.nickel.plate;
var sip = metals.silver.plate;
var gp = metals.gold.plate;
var pp = metals.platinum.plate;
I then replaced all the global map references in the map to the local variable, and everything worked for that file. I then, for the sake of testing if maybe it was the size of the file, created an array with 4 THOUSAND lines. The file size used to be 20KB, and is now erroring that its 122KB, but was fine around 3 thousand lines, and 103KB file size.
Am I just misunderstanding how something works here?
https://stackoverflow.com/a/6570454
ZenScript is subject to the same limits as java