Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create basic aspect of Thaumcraft #228

Closed
EdwinYoungSteve opened this issue Aug 27, 2024 · 6 comments · Fixed by #231
Closed

Cannot create basic aspect of Thaumcraft #228

EdwinYoungSteve opened this issue Aug 27, 2024 · 6 comments · Fixed by #231
Labels
bug Something isn't working

Comments

@EdwinYoungSteve
Copy link

If I don't fill in any sub-aspects, debugging will show an array out-of-bounds exception.

@kappa-maintainer
Copy link

Post full debug log

@EdwinYoungSteve
Copy link
Author

============ GroovyLog ==== 27.08.2024 ============ GroovyScript version: 1.1.3 [16:19:56] [CLIENT/INFO] [greedycraft]: Running scripts in loader 'preInit' [16:20:44] [CLIENT/INFO] [greedycraft]: Running scripts in loader 'init' [16:20:45] [CLIENT/INFO] [greedycraft]: - running init.thaumcraft [16:20:45] [CLIENT/ERROR] [greedycraft]: An exception occurred while running scripts. Look at latest.log for a full stacktrace: java.lang.ArrayIndexOutOfBoundsException: 0 at thaumcraft.api.aspects.Aspect.<init>(Aspect.java:48) at com.cleanroommc.groovyscript.compat.mods.thaumcraft.aspect.Aspect$AspectBuilder.register(Aspect.java:120) at init.thaumcraft.run(thaumcraft.groovy:15) at com.cleanroommc.groovyscript.sandbox.GroovySandbox.runScript(GroovySandbox.java:167) at com.cleanroommc.groovyscript.sandbox.GroovyScriptSandbox.runScript(GroovyScriptSandbox.java:181) at com.cleanroommc.groovyscript.sandbox.GroovySandbox.loadScripts(GroovySandbox.java:140) [16:20:50] [CLIENT/INFO] [greedycraft]: Running scripts in loader 'postInit'
image

@brachy84
Copy link
Member

thats not the debug log. Thats the groovy log

@WaitingIdly
Copy link
Collaborator

pretty sure this is the issue, line 120 in Aspect.java

https://github.com/CleanroomMC/GroovyScript/blob/master/src/main/java/com/cleanroommc/groovyscript/compat/mods/thaumcraft/aspect/Aspect.java#L120-L120

-                thaumcraft.api.aspects.Aspect aspect = new thaumcraft.api.aspects.Aspect(tag, chatColor, components.getAspects(), image, blend);
+                thaumcraft.api.aspects.Aspect aspect = new thaumcraft.api.aspects.Aspect(tag, chatColor, components.size() == 0 ? null : components.getAspects(), image, blend);

@EdwinYoungSteve
Copy link
Author

[16:20:45] [Client thread/ERROR]: Throwing
java.lang.ArrayIndexOutOfBoundsException: 0
at thaumcraft.api.aspects.Aspect.(Aspect.java:48) ~[Aspect.class:?]
at com.cleanroommc.groovyscript.compat.mods.thaumcraft.aspect.Aspect$AspectBuilder.register(Aspect.java:120) ~[Aspect$AspectBuilder.class:?]
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321) ~[IndyInterface.class:?]
at init.thaumcraft.run(thaumcraft.groovy:15) ~[?:?]
at com.cleanroommc.groovyscript.sandbox.GroovySandbox.runScript(GroovySandbox.java:167) ~[GroovySandbox.class:?]
at com.cleanroommc.groovyscript.sandbox.GroovyScriptSandbox.runScript(GroovyScriptSandbox.java:181) ~[GroovyScriptSandbox.class:?]
at com.cleanroommc.groovyscript.sandbox.GroovySandbox.loadScripts(GroovySandbox.java:140) ~[GroovySandbox.class:?]
at com.cleanroommc.groovyscript.sandbox.GroovySandbox.load(GroovySandbox.java:121) ~[GroovySandbox.class:?]
at com.cleanroommc.groovyscript.sandbox.GroovySandbox.load(GroovySandbox.java:109) ~[GroovySandbox.class:?]
at com.cleanroommc.groovyscript.sandbox.GroovyScriptSandbox.run(GroovyScriptSandbox.java:164) [GroovyScriptSandbox.class:?]
at com.cleanroommc.groovyscript.GroovyScript.runGroovyScriptsInLoader(GroovyScript.java:188) [GroovyScript.class:?]
at net.minecraftforge.fml.common.LoadController.handler$zzi000$preInit(LoadController.java:1021) [LoadController.class:?]
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java) [LoadController.class:?]
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:754) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535) [bib.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_421]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_421]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_421]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_421]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
[16:20:45] [Client thread/INFO]: Running Groovy scripts during init took 1821 ms

@EdwinYoungSteve
Copy link
Author

很确定这就是问题所在,第 120 行Aspect.java

https://github.com/CleanroomMC/GroovyScript/blob/master/src/main/java/com/cleanroommc/groovyscript/compat/mods/thaumcraft/aspect/Aspect.java#L120-L120

-                thaumcraft.api.aspects.Aspect aspect = new thaumcraft.api.aspects.Aspect(tag, chatColor, components.getAspects(), image, blend);
+                thaumcraft.api.aspects.Aspect aspect = new thaumcraft.api.aspects.Aspect(tag, chatColor, components.size() == 0 ? null : components.getAspects(), image, blend);

so……can u fix this bug? plz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants