VivecraftMod icon indicating copy to clipboard operation
VivecraftMod copied to clipboard

Crash when pressing RCtrl+R while in non VR mode

Open aaronjamt opened this issue 1 year ago • 3 comments

While on a 1.21 multiplayer server without VR enabled, I pressed Right Ctrl+R and the game crashed with the following stack trace.

[18:27:35] [Render thread/ERROR]: Unreported exception thrown! java.lang.NullPointerException: Cannot invoke "org.vivecraft.client_vr.gameplay.VRPlayer.isTeleportOverridden()" because "dataholder.vrPlayer" is null at org.vivecraft.client_vr.settings.VRHotkeys.handleKeyboardInputs(VRHotkeys.java:64) ~[vivecraft-1.21-1.1.12-b5-fabric.jar:?] at net.minecraft.class_309.handler$fje000$vivecraft$screenHandler(class_309.java:5646) ~[client-intermediary.jar:?] at net.minecraft.class_309.method_1466(class_309.java:346) ~[client-intermediary.jar:?] at net.minecraft.class_309.method_22678(class_309.java:499) ~[client-intermediary.jar:?] at net.minecraft.class_1255.execute(class_1255.java:108) ~[client-intermediary.jar:?] at net.minecraft.class_309.method_22676(class_309.java:499) ~[client-intermediary.jar:?] at org.lwjgl.glfw.GLFWKeyCallback$Container.invoke(GLFWKeyCallback.java:82) ~[lwjgl-glfw-3.3.3.jar:?] at com.moulberry.flashback.editor.ui.CustomImGuiImplGlfw.keyCallback(CustomImGuiImplGlfw.java:323) ~[flashback-0.10.0.jar:?] at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:44) ~[lwjgl-glfw-3.3.3.jar:?] at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.3.jar:?] at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3438) ~[lwjgl-glfw-3.3.3.jar:?] at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:150) ~[client-intermediary.jar:?] at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:168) ~[client-intermediary.jar:?] at net.minecraft.class_1041.method_15998(class_1041.java:303) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1523(class_310.java:1307) ~[client-intermediary.jar:?] at net.minecraft.class_310.method_1514(class_310.java:882) [client-intermediary.jar:?] at net.minecraft.client.main.Main.main(Main.java:256) [client-intermediary.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.15.11.jar:?] at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:100) [NewLaunch.jar:?] at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) [NewLaunch.jar:?] at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) [NewLaunch.jar:?]

aaronjamt avatar Sep 30 '24 01:09 aaronjamt

I'm not able to test this at the moment, but I think adding if (dataholder.vrPlayer != null) { at line 64 of VRHotkeys.java should fix this. I'll open a draft PR in case anyone's able to test it.

Edit: See #300

aaronjamt avatar Sep 30 '24 01:09 aaronjamt

it should check if vr is initialized, I'll add it to the cleanup pr

fayer3 avatar Sep 30 '24 01:09 fayer3

most of these things should generally only trigger with vr on imo.

fayer3 avatar Sep 30 '24 01:09 fayer3