Open kameronnaxton opened 6 years ago
you did not give any versions of any mods used. this means nobody can help you.
I have the same problem using a (slightly modified) DW20 1.12.2 modpack. Modifications have nothing to do with gendustry nor with crash. Everything worked fine until ftblauncher downloaded some minecraft .lang files; since then it crashes every time. Mod version: 1.6.5.8
override def onResourceManagerReload(rm: IResourceManager): Unit = {
val newLang = Client.minecraft.getLanguageManager.getCurrentLanguage
Gendustry.logInfo("Resource manager reload, new language: %s", newLang.getLanguageCode)
val configFiles = Gendustry.configDir.list().sorted
configFiles.filter(_.endsWith(".en_US.lang")).foreach(loadLangFile)
if (newLang.getLanguageCode != "en_US")
configFiles.filter(_.endsWith("." + newLang.getLanguageCode + ".lang")).foreach(loadLangFile)
}
Line 35 is the logInfo call. The only thing that can be a null pointer here is newLang - this implies that the current language may not be loaded at that time. Quick fix might be a config option to toggle support of other languages... (only suggesting this since the occurrence of such crashes seems quite limited).
EDIT: getLanguageCode might be null, too, but I in that case the crash should happen when logInfo tries to access that value, right?
getstatic net.bdew.gendustry.Gendustry$ net.bdew.gendustry.Gendustry$.MODULE$
ldc "Resource manager reload, new language: %s"
getstatic scala.Predef$ scala.Predef$.MODULE$
iconst_1
anewarray java.lang.Object
dup
iconst_0
aload_2
invokevirtual java.lang.String net.minecraft.client.resources.Language.func_135034_a()
aastore
invokevirtual scala.collection.mutable.WrappedArray scala.Predef$.genericWrapArray(java.lang.Object)
invokevirtual void net.bdew.gendustry.Gendustry$.logInfo(java.lang.String, scala.collection.Seq)
this is the relevant jasmin disassembly - the only thing that could throw a NPE seems to be the invokevirtual func_125034_a() which, according to a methods.csv I found online, is getLanguageCode. This means that LanguageManager.getCurrentLanguage (invokevirtual net.minecraft.client.resources.Language net.minecraft.client.resources.LanguageManager.func_135041_c()
) returns a NP.
I was getting this same crash on a custom modpack and it has just successfully loaded MC. It seems as though it was something not-related to Gendustry itself because I haven't changed anything myself
@JamesYeoman the problem was a language file auto-update by microsoft. Apparently they fixed it...
i need a fix
Time: 7/19/18 4:24 PM Description: There was a severe problem during mod loading that has caused the game to fail
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from GenDustry (gendustry) Caused by: java.lang.NullPointerException at net.bdew.gendustry.misc.ResourceListener$.func_110549_a(ResourceListener.scala:35) at net.minecraft.client.resources.SimpleReloadableResourceManager.func_110542_a(SimpleReloadableResourceManager.java:121) at net.bdew.gendustry.misc.ResourceListener$.init(ResourceListener.scala:21) at net.bdew.gendustry.GendustryClient$.preInit(GendustryClient.scala:20) at net.bdew.gendustry.Gendustry$.preInit(Gendustry.scala:78) at net.bdew.gendustry.Gendustry.preInit(Gendustry.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:627) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:245) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:466) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)