MidnightControls

MidnightControls

447k Downloads

Crash: Pluging in controller while not in-game

programmerlexi opened this issue ยท 1 comments

commented

Describe the bug
Game crashes when pluging in controller

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Main menu'
  2. Plug in controller
  3. Game crashes

Expected behavior
Not crashing

Desktop (please complete the following information):

  • OS: Linux (but this should be platform independent)
  • Minecraft 1.20.6
  • Modloader Fabric Loader 0.15.11
  • Fabric/Quilt Libraries fabric-api-0.98.0+1.20.6
  • Version 1.9.5

Additional context
java.lang.IllegalStateException: Cannot get payload sender when not in game!
at net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking.getSender(ClientPlayNetworking.java:230)
at eu.midnightdust.midnightcontrols.client.MidnightControlsClient.switchControlsMode(MidnightControlsClient.java:260)
at eu.midnightdust.midnightcontrols.client.MidnightControlsClient.lambda$onMcInit$5(MidnightControlsClient.java:172)
at org.lwjgl.glfw.GLFWJoystickCallbackI.callback(GLFWJoystickCallbackI.java:43)
at org.lwjgl.system.JNI.invokeV(Native Method)
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3438)
at com.mojang.blaze3d.systems.RenderSystem.pollEvents(RenderSystem.java:200)
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:218)
at net.minecraft.class_1041.method_15998(class_1041.java:287)
at net.minecraft.class_310.method_1523(class_310.java:1342)
at net.minecraft.class_310.method_1514(class_310.java:888)
at net.minecraft.client.main.Main.main(Main.java:265)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

commented

Proposed solution: Do a check