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

Fixed Bug where the Client crashes with a NullPointerException while … #54

Open
wants to merge 1 commit into
base: 1.12.X
Choose a base branch
from

Conversation

davidmayr
Copy link

…disconnecting

I got this error:
`Time: 2020-04-19 21:33:12 CEST
Description: Unexpected error

java.lang.NullPointerException
at com.mrcrayfish.guns.object.Bullet.tick(Bullet.java:55)
at com.mrcrayfish.guns.client.event.RenderEvents.lambda$onTickBullets$0(RenderEvents.java:1040)
at com.mrcrayfish.guns.client.event.RenderEvents$$Lambda$4699/1767584718.accept(Unknown Source)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at com.mrcrayfish.guns.client.event.RenderEvents.onTickBullets(RenderEvents.java:1040)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1668_RenderEvents_onTickBullets_ClientTickEvent.invoke(.dynamic)
at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
at net.minecraftforge.fml.common.FMLCommonHandler.onPostClientTick(FMLCommonHandler.java:349)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1911)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1098)
at net.minecraft.client.Minecraft.run(Minecraft.java:3942)
at net.minecraft.client.main.Main.main(SourceFile: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:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

`
while disconnecting. I was playing on a Modded Server with 150 Mods and the disconnecting took a while. That was probably the problem. The nullpointer can only be in the world parameter. So I added a "world== null return" statement

@otakup0pe
Copy link

Any traction on this? It seems to be relatively widespread. I'm getting strong "1.12 is not supported anymore" vibes.

@davidmayr
Copy link
Author

I don't think he will ever merge this...

@davidmayr
Copy link
Author

And I don't think this would even work.
Why should the World be null when disconnecting? I should have checked if the world is still loaded or something.

@davidmayr
Copy link
Author

I will try fixing it later

@davidmayr
Copy link
Author

davidmayr commented Jul 11, 2020

Okay just found out that @MrCrayfish did this:
bullets.forEach(bullet -> bullet.tick(Minecraft.getMinecraft().world));
so it should work... and bullets gets never set to null..

@otakup0pe
Copy link

otakup0pe commented Jul 14, 2020

Okay just found out that @MrCrayfish did this:

In the 1.12 or later versions? I can't tell if the implication is this was fixed or not.

@Coloradohusky
Copy link

Sadly, this bug is still an issue with the latest version (0.15.3)

@davidmayr
Copy link
Author

It looks like this will never be accepted and 1.12 is a good Version for Mods but there are so many new and updated mods for never Versions so maybe you could start a new Modpack? Vanilla is also fun 😉

AFAIK it still crashes sometimes. Maybe a check if the entity is null would be useful too.

You can try implementing and compiling this yourself though.

@MikhailTapio
Copy link

How about implementing this with mixin?

@davidmayr
Copy link
Author

How about implementing this with mixin?

Huh? Do you mean a mixin for this mod's class? Wouldn't it be just easier to compile this yourself and maybe add an entity check? I don't see why a mixin should be implemented for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants