quat1024 / modern-forge-1.12-template

Let's use ForgeGradle 5.1 to maintain a Forge 1.12 mod in 2023.
37 stars 1 forks source link

./gradlew runClient: java.lang.NullPointerException at net.minecraftforge.fml.common.network.NetworkRegistry.newChannel(NetworkRegistry.java:207) #2

Open les-citrons opened 8 months ago

les-citrons commented 8 months ago
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Forge Mod Loader (FML)
Caused by: java.lang.NullPointerException
        at net.minecraftforge.fml.common.network.NetworkRegistry.newChannel(NetworkRegistry.java:207)
        at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.registerChannel(FMLNetworkHandler.java:185)
        at net.minecraftforge.fml.common.FMLContainer.modConstruction(FMLContainer.java:92)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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:219)
        at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        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:136)
        at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)
        at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:232)
        at net.minecraft.client.Minecraft.init(Minecraft.java:467)
        at net.minecraft.client.Minecraft.run(Minecraft.java:378)
        at net.minecraft.client.main.Main.main(Main.java:123)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at net.minecraftforge.legacydev.Main.start(Main.java:86)
        at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29)

I got this error with the forge-provided MDK as well.

Incandescent-Turtle commented 6 months ago

I am also getting this exception.

I am just cloning this repo and trying to build and run it as-is and no dice

mica-alex commented 5 months ago

Same issue here

quat1024 commented 5 months ago

Odd, maybe something in Forge broke. I'll look into this after i get settled with uni

mica-alex commented 5 months ago

This is currently holding me back from proper development on two of my current mods, so I am also looking into the issue. If I figure it out, I will let you know. This does not appear to be specific to this repo though, as it's been posted a few times through out the years: https://github.com/MinecraftForge/ForgeGradle/issues/748

Edit: This is also relevant, but I have not been able to resolve using the suggestions: https://stackoverflow.com/questions/68377027/minecraft-forge-mod-loader-fml-loading-and-crashing-mc

Edit: More relevant information: https://github.com/MinecraftForge/ForgeGradle/issues/750

ph1823 commented 4 months ago

Same issue her try to delee gradle cache, no work, follow the link of @mica-alex no work :/ have you a solution to fix this error ? thank !

GatoDev commented 4 months ago

I don't know why repo owner is deleting the comments…

I must say that this type of errors still happen to me, but now Minecraft initializes anyway. Before was not letting start it. But now yes, I don't know why TBH.

quat1024 commented 4 months ago

Because your comments are worthless and just say "bump"

quat1024 commented 4 months ago

This is just a template repo, guys. I did not write ForgeGradle, I do not maintain ForgeGradle, and I have no idea how it works. Instead of sending me daily "bump" emails, you could try doing your own debugging. You're going to be starting from the same position I was starting from because again, I did not write ForgeGradle.

ph1823 commented 4 months ago

I don't know why repo owner is deleting the comments…

I must say that this type of errors still happen to me, but now Minecraft initializes anyway. Before was not letting start it. But now yes, I don't know why TBH.

For me that dont start and my error is appeared before install mixin on a project mods si i try to demo/template project and still dont work :(

This is just a template repo, guys. I did not write ForgeGradle, I do not maintain ForgeGradle, and I have no idea how it works. Instead of sending me daily "bump" emails, you could try doing your own debugging. You're going to be starting from the same position I was starting from because again, I did not write ForgeGradle.

You can unsubscribe to this issue no ? I understand that it is frustrating to receive emails about a bug that you are not the author of, but it is also frustrating for us to have this bug and for testing our mods to have to go to another PC or the build, because yes on another PC my runClient works and when I test my mods on the Minecraft launcher it works too.

You can closed this issue if you want and as well as prohibit future comments if you really want to stop receiving emails.

ph1823 commented 4 months ago

For everyone has this problme, i have found a solution for me. By asking the Minecraft Forge France community, they redirected me to several posts and recommended that I download the project sources, it worked.

You can follow this: https://www.jetbrains.com/idea/whatsnew/#page__content-build-tools to download the sources or click on the "download" icon on your gradle project.

Hope it works for you too.

christiaan20 commented 3 months ago

For everyone has this problme, i have found a solution for me. By asking the Minecraft Forge France community, they redirected me to several posts and recommended that I download the project sources, it worked.

You can follow this: https://www.jetbrains.com/idea/whatsnew/#page__content-build-tools to download the sources or click on the "download" icon on your gradle project.

Hope it works for you too.

While your proposed solution here didn't work for me. It did give me the idea that maybe this new feature of intellij 2023 is the issue and low and behold downgrading to a good old intellij 2021 fixed this issue for me, thx for the inspiration!

GatoDev commented 3 months ago

Thanks you all guys for sharing your solutions. If this happens again to me I will check them all.