GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.88k stars 270 forks source link

NullPointerException on client while connecting to glowstone server #1094

Open SHADOWDANCH opened 4 years ago

SHADOWDANCH commented 4 years ago

While joining to glowstone server from 1.12.2 client (with/without forge etc) will throw a bunch of NullPointerException's (https://hastebin.com/raw/obopadoxab). Most likely this is due to some messages are sent before JoinGameMessage and on clientside player entity still not initialized. For example while loading player data from EntityStorage at some point server tries to close opened inventory and sends player SetWindowSlotMessage.

[16:38:39] [main/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_51]
    at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_51]
    at h.a(Util.java:48) [h.class:?]
    at bib.az(SourceFile:991) [bib.class:?]
    at bib.a(SourceFile:419) [bib.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:159) [launchwrapper-of-2.1.jar:2.1]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:30) [launchwrapper-of-2.1.jar:2.1]
Caused by: java.lang.NullPointerException
    at brz.a(SourceFile:458) ~[brz.class:?]
    at kf.a(SourceFile:66) ~[kf.class:?]
    at kf.a(SourceFile:9) ~[kf.class:?]
    at hv$1.run(PacketThreadUtil.java:22) ~[hv$1.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_51]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_51]
    at h.a(Util.java:47) ~[h.class:?]
    ... 9 more
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/91526798-nullpointerexception-on-client-while-connecting-to-glowstone-server?utm_campaign=plugin&utm_content=tracker%2F14691067&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F14691067&utm_medium=issues&utm_source=github).
mastercoms commented 2 years ago

I fixed JoinGameMessage being after a few player messages, but I still get this exception.