AMereBagatelle / AFKPeace

A mod for peace of mind while AFKing!
MIT License
20 stars 8 forks source link

[Crash] NullPointerException when clicking "Reconnect" while having invalid session #6

Closed AlexanderRitter02 closed 4 years ago

AlexanderRitter02 commented 4 years ago

Describe the bug

The game crashes when clicking on Reconnect if the session is invalid. java.lang.NullPointerException: mouseClicked event handler

Crash Report ``` ---- Minecraft Crash Report ---- // Uh... Did I do that? Time: 15.07.20 14:12 Description: mouseClicked event handler java.lang.NullPointerException: mouseClicked event handler at net.minecraft.class_412.(class_412.java:41) at amerebagatelle.github.io.afkpeace.ConnectionManager.connectToServer(ConnectionManager.java:53) at net.minecraft.class_419.md18979d$lambda$onInit$0$0(class_419.java:526) at net.minecraft.class_419$$Lambda$3617/342479178.onPress(Unknown Source) at net.minecraft.class_4185.method_25306(class_4185.java:33) at net.minecraft.class_4264.method_25348(class_4264.java:16) at net.minecraft.class_339.method_25402(class_339.java:149) at net.minecraft.class_4069.method_25402(class_4069.java:27) at net.minecraft.class_312.method_1611(class_312.java:92) at net.minecraft.class_312$$Lambda$3402/1163723373.run(Unknown Source) at net.minecraft.class_437.method_25412(class_437.java:431) at net.minecraft.class_312.method_1601(class_312.java:92) at net.minecraft.class_312.method_22686(class_312.java:162) at net.minecraft.class_312$$Lambda$3401/2021304817.run(Unknown Source) at net.minecraft.class_1255.execute(class_1255.java:94) at net.minecraft.class_312.method_22684(class_312.java:162) at net.minecraft.class_312$$Lambda$2620/959744451.invoke(Unknown Source) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:109) at net.minecraft.class_1041.method_15998(class_1041.java:308) at net.minecraft.class_310.method_1523(class_310.java:1041) at net.minecraft.class_310.method_1514(class_310.java:654) at net.minecraft.client.main.Main.main(Main.java:215) 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.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:192) at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:140) at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at net.minecraft.class_412.(class_412.java:41) at amerebagatelle.github.io.afkpeace.ConnectionManager.connectToServer(ConnectionManager.java:53) at net.minecraft.class_419.md18979d$lambda$onInit$0$0(class_419.java:526) at net.minecraft.class_419$$Lambda$3617/342479178.onPress(Unknown Source) at net.minecraft.class_4185.method_25306(class_4185.java:33) at net.minecraft.class_4264.method_25348(class_4264.java:16) at net.minecraft.class_339.method_25402(class_339.java:149) at net.minecraft.class_4069.method_25402(class_4069.java:27) at net.minecraft.class_312.method_1611(class_312.java:92) at net.minecraft.class_312$$Lambda$3402/1163723373.run(Unknown Source) -- Affected screen -- Details: Screen name: net.minecraft.class_419 Stacktrace: at net.minecraft.class_437.method_25412(class_437.java:431) at net.minecraft.class_312.method_1601(class_312.java:92) at net.minecraft.class_312.method_22686(class_312.java:162) at net.minecraft.class_312$$Lambda$3401/2021304817.run(Unknown Source) at net.minecraft.class_1255.execute(class_1255.java:94) at net.minecraft.class_312.method_22684(class_312.java:162) at net.minecraft.class_312$$Lambda$2620/959744451.invoke(Unknown Source) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:109) at net.minecraft.class_1041.method_15998(class_1041.java:308) at net.minecraft.class_310.method_1523(class_310.java:1041) at net.minecraft.class_310.method_1514(class_310.java:654) at net.minecraft.client.main.Main.main(Main.java:215) 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.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:192) at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:140) at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:26) -- System Details -- Details: Minecraft Version: 1.16.1 Minecraft Version ID: 1.16.1 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 1050142448 bytes (1001 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB) CPUs: 4 JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M Fabric Mods: afkpeace: AFKPeace 4.3.0 autoconfig1u: Auto Config v1 Updated 3.2.0-unstable beenfo: Beenfo 1.16-fabric0.13.1-1.1 boostedbrightness: Boosted Brightness 1.0.0 clearview: Clear View 2.1 cloth-basic-math: Cloth Basic Math 0.5.1 cloth-client-events-v0: Cloth Client Events v0 1.0.4 cloth-config2: Cloth Config v4 4.5.6 cotton-client-commands: Cotton Client Commands 1.0.1+1.16-rc1 duyguji-client-base: Duyguji 0.3.0 fabric: Fabric API 0.14.1+build.372-1.16 fabric-api-base: Fabric API Base 0.1.3+12a8474c02 fabric-biomes-v1: Fabric Biomes (v1) 0.2.7+059ea86602 fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.4+c6a8ea8902 fabric-command-api-v1: Fabric Command API (v1) 1.0.8+5ce5339802 fabric-commands-v0: Fabric Commands (v0) 0.2.0+52d3083602 fabric-containers-v0: Fabric Containers (v0) 0.1.8+045df74f02 fabric-content-registries-v0: Fabric Content Registries (v0) 0.1.9+059ea86602 fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.2+b7f9825d02 fabric-dimensions-v1: fabric-dimensions-v1 1.0.0+a71b305302 fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.3.3+7066030f02 fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.0+16acbe5b02 fabric-item-api-v1: Fabric Item API (v1) 1.0.0+16acbe5b02 fabric-item-groups-v0: Fabric Item Groups (v0) 0.2.0+438f963602 fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.0+e16a977402 fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.0+3fa9f7c502 fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.0.0+b0993bc102 fabric-loot-tables-v1: Fabric Loot Tables (v1) 0.1.10+059ea86602 fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.2+b764ce9902 fabric-models-v0: Fabric Models (v0) 0.1.0+dfdb52d602 fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.5+b50ffc7b02 fabric-networking-v0: Fabric Networking (v0) 0.1.10+e00ecb5f02 fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.5.5+e00ecb5f02 fabric-object-builders-v0: Fabric Object Builders (v0) 0.6.0+da175ad602 fabric-particles-v1: fabric-particles-v1 0.2.1+0a6f2a7002 fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.3.8+7dba2d6c02 fabric-renderer-api-v1: Fabric Renderer API (v1) 0.2.13+eae12eb802 fabric-renderer-indigo: Fabric Renderer - Indigo 0.3.2+4d66bed502 fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 2.0.1+5a0f9a6002 fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.3+b7f9825d02 fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.8+b7084faa02 fabric-rendering-v0: Fabric Rendering (v0) 1.1.0+5341049002 fabric-rendering-v1: Fabric Rendering (v1) 1.1.2+346247d702 fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.2.6+f41e209802 fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.0.1+f362c86e02 fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 0.2.7+a4c57d8e02 fabric-textures-v0: Fabric Textures (v0) 1.0.4+eae12eb802 fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.1.4+5794386e02 fabricloader: Fabric Loader 0.8.9+build.203 fiber: fiber 0.23.0-1 horsestatsvanilla: Horse Stats Vanilla 2.0.1 lambdynlights: LambDynamicLights 1.2.1+1.16.1 lightoverlay: Light Overlay 5.4.0 litematica: Litematica 0.0.0-dev.20200711.162756 lithium: Lithium 0.5.1 malilib: MaLiLib 0.10.0-dev.21+arne.1 minecraft: Minecraft 1.16.1 modmenu: Mod Menu 1.14.0+build.24 okzoomer: Ok Zoomer 4.0.0-alpha.5+20w27a-github.53 org_apache_commons_commons-collections4: commons-collections4 4.0 phosphor: Phosphor 0.6.0+build.7 shieldisruptor: Shield Disruptor 1.0.1 shulkerboxtooltip: Shulker Box Tootip 2.1.0+1.16.1 sodium: Sodium 0.1.0 spruceui: SpruceUI 1.5.8 Launched Version: fabric-loader-0.8.9+build.203-1.16.1 Backend library: LWJGL version 3.2.2 build 10 Backend API: GeForce GTX 950M/PCIe/SSE2 GL version 4.6.0 NVIDIA 451.67, NVIDIA Corporation GL Caps: Using framebuffer using OpenGL 3.0 Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'fabric' Type: Client (map_client.txt) Resource Packs: vanilla Current Language: English (US) CPU: 4x Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz ```

Link to crash report as .txt

2020-07-15_14 16 20

To Reproduce

  1. Invalidate your session somehow
  2. Connect to a server, it should show the same message as above in the picture
  3. Click on Reconnect

❌ The game crashes

Expected behavior

  1. Not crash
  2. ❗ If the session is invalid, AFKPeace should stop trying to re-connect, as it will never be successful
  3. (Eventually maybe add integration with re-authentication mods. I will create a suggestion for that later.)

Additional context This is what the dedicated server sees when a player with an invalid sessions tries to connect:

[14:16:18] [Server thread/INFO] (Minecraft) com.mojang.authlib.GameProfile@23798faa[id=<null>,name=Player321,properties={},legacy=false] (/127.0.0.1:60582) lost connection: Disconnected
AMereBagatelle commented 4 years ago

Can't reproduce, but that may just be from lack of proper testing. Going to leave this open for now, as it seems valid in any case. A full log would be appreciated as well, as opposed to just the crash log.

AlexanderRitter02 commented 4 years ago

This is the full log: latest.log Or on pastebin.

I can reproduce every time with only AFKPeace and Fabric API, found a way to invalidate my session:

:arrow_right: session is now invalid

AlexanderRitter02 commented 4 years ago

Btw just tried latest commit, still crashes.

AMereBagatelle commented 4 years ago

I've found the problem to some extent, it is a incompatibility with Fabric API. The mod now works without it, so for now you can simply remove Fabric API if other mods are not using it, but I will fix this as soon as possible.