GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
290 stars 171 forks source link

Crash with other mods on startup #782

Closed lonevox closed 9 months ago

lonevox commented 9 months ago

GregTech CEu Version

1.1.0

Recipe Viewer Installed

EMI

Environment

Singleplayer

Cross-Mod Interaction

Yes

Expected Behavior

Game gets to the title screen.

Actual Behavior

GT crashes with the error java.lang.NullPointerException: Cannot invoke "com.gregtechceu.gtceu.api.data.chemical.material.IMaterialRegistryManager.getRegistry(String)" because "com.gregtechceu.gtceu.api.GTCEuAPI.materialManager" is null

Steps to Reproduce

Run GT with the mods listed in the logs (though some of these mods are disabled, the crash happens regardless).

Additional Information

This crash didnt happen with the same set of mods in the previous version of gtceu modern. I've tried narrowing down what combination of mods causes this error but I'm stumped. It seems to happen only when a combination of mods are there (potentially Steam n Rails + embeddium + balm + at least 1 other but I dont know what they are). The crash only happens about 50% of the time which makes it very hard to test. debug.log and latest.log: https://gist.github.com/lonevox/ebfc7e089a9dcd2913ace3bfe4d5409d

lonevox commented 9 months ago

The issue isn't fixed. Here's the latest.log with 1.1.1: https://gist.github.com/lonevox/5f02bab3c957fb9cef93616c301a1377 For comparison, here's my latest.log using version 1.0.20.b: https://gist.github.com/lonevox/20afee499ac5d7e462668eb9c5e1a489

lonevox commented 9 months ago

This seems to be caused by having a kubejs script with an error in either client_scripts or startup_scripts

Goldgom commented 9 months ago

1.1.1.a this issue is still here when gtceu and kubejs and more mods were loaded.single gtecu and kubejs will not cause this issue.that's really a mass. i even dont know who cause this issue ,because when i find this issue,i have 100+mods in my game!

Goldgom commented 9 months ago

the error seems is [02:34:34] [modloading-worker-0/ERROR]: Failed to create mod instance. ModID: gtceu, class com.gregtechceu.gtceu.GTCEu java.lang.NoClassDefFoundError: Could not initialize class com.gregtechceu.gtceu.api.registry.GTRegistries at com.gregtechceu.gtceu.common.CommonProxy.(CommonProxy.java:67) ~[gtceu-1.20.1-1.1.1.a-build_452.jar%23315!/:?] at com.gregtechceu.gtceu.client.ClientProxy.(ClientProxy.java:21) ~[gtceu-1.20.1-1.1.1.a-build_452.jar%23315!/:?] at net.minecraftforge.fml.DistExecutor.unsafeRunForDist(DistExecutor.java:160) ~[fmlcore-1.20.1-47.2.20.jar%23363!/:?] at com.gregtechceu.gtceu.GTCEu.(GTCEu.java:25) ~[gtceu-1.20.1-1.1.1.a-build_452.jar%23315!/:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:70) ~[javafmllanguage-1.20.1-47.2.20.jar%23364!/:?] at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:124) ~[fmlcore-1.20.1-47.2.20.jar%23363!/:?] at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]

screret commented 9 months ago

yesyes we know

gre4kapi commented 9 months ago

same error latest.log

gre4kapi commented 9 months ago

[net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to create mod instance. ModID: kubejs, class dev.latvian.mods.kubejs.forge.KubeJSForge java.lang.ExceptionInInitializerError: null at com.gregtechceu.gtceu.integration.kjs.GregTechKubeJSPlugin.init(GregTechKubeJSPlugin.java:83) ~[gtceu-1.20.1-1.1.1.a-build_455.jar%23161!/:?] at java.util.ArrayList.forEach(ArrayList.java:1596) ~[?:?] ... Caused by: java.lang.NullPointerException: Cannot invoke "com.gregtechceu.gtceu.api.data.chemical.material.IMaterialRegistryManager.getRegistry(String)" because "com.gregtechceu.gtceu.api.GTCEuAPI.materialManager" is null at com.gregtechceu.gtceu.integration.kjs.GTRegistryInfo.<clinit>(GTRegistryInfo.java:45) ~[gtceu-1.20.1-1.1.1.a-build_455.jar%23161!/:?] ... 17 more latest.log still error all working with gtceu 1.1.0 (pls fix this I just want to play my beloved gregtech with kubejs ^_^ )

screret commented 9 months ago

Did you consider that it was just fixed, and thus is not in a release yet?

Exzept1on commented 9 months ago

He checked it on the last build

screret commented 9 months ago

Oh ic

Exzept1on commented 9 months ago

Previously (on 1.1.1.a) there were two errors when crashing, one in gtceu and the other in kubejs, now on the last build it gives only the kubejs error

Exzept1on commented 9 months ago

Tested this: https://github.com/GregTechCEu/GregTech-Modern/commit/9f9f6f15c3694c0c9bba9a6a44bf896760baf8b6

Now works fine. Thanks for fix