sammko/servertick-fabric

Minecraft crashed after disconnecting from server

Closed this issue · 3 comments

This only happened once and based on the traceback, it looks like servertick caused it. I can't reproduce it, but thought I would post here if it's helpful.

---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.

Time: 2/4/21 5:07 PM
Description: Unexpected error

java.lang.IllegalStateException: Cannot send packet to server while not in game!
	at net.fabricmc.fabric.impl.networking.ClientSidePacketRegistryImpl.sendToServer(ClientSidePacketRegistryImpl.java:51)
	at net.fabricmc.fabric.api.network.ClientSidePacketRegistry.sendToServer(ClientSidePacketRegistry.java:70)
	at net.fabricmc.fabric.api.network.ClientSidePacketRegistry.sendToServer(ClientSidePacketRegistry.java:89)
	at net.cavoj.servertick.NetworkC2S.sendToggle(NetworkC2S.java:14)
	at net.cavoj.servertick.ServerTickClient.setTpsEnabled(ServerTickClient.java:55)
	at net.minecraft.class_309.handler$znh000$onKey(class_309.java:1040)
	at net.minecraft.class_309.method_1466(class_309.java:408)
	at net.minecraft.class_309.method_22678(class_309.java:433)
	at net.minecraft.class_309$$Lambda$3155/824819458.run(Unknown Source)
	at net.minecraft.class_1255.execute(class_1255.java:94)
	at net.minecraft.class_309.method_22676(class_309.java:433)
	at net.minecraft.class_309$$Lambda$2403/2136195660.invoke(Unknown Source)
	at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:37)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3174)
	at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem.java:127)
	at net.minecraft.class_310.method_1523(class_310.java:1071)
	at net.minecraft.class_310.method_1514(class_310.java:681)
	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:226)
	at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:139)
	at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:27)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.16.5
	Minecraft Version ID: 1.16.5
	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: 386499184 bytes (368 MB) / 872415232 bytes (832 MB) up to 2147483648 bytes (2048 MB)
	CPUs: 12
	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: 
		autoconfig1u: Auto Config v1 Updated 3.2.2
		cloth-basic-math: Cloth Basic Math 0.5.1
		cloth-config2: Cloth Config v4 4.8.3
		com_moandjiezana_toml_toml4j: toml4j 0.7.2
		dynamicfps: Dynamic FPS 2.0.1
		fabric: Fabric API 0.30.0+1.16
		fabric-api-base: Fabric API Base 0.2.0+daa38b3d7d
		fabric-biome-api-v1: Fabric Biome API (v1) 3.1.1+ca58154a7d
		fabric-blockrenderlayer-v1: Fabric BlockRenderLayer Registration (v1) 1.1.5+ca58154a7d
		fabric-command-api-v1: Fabric Command API (v1) 1.0.10+ca58154a7d
		fabric-commands-v0: Fabric Commands (v0) 0.2.2+ca58154a7d
		fabric-containers-v0: Fabric Containers (v0) 0.1.10+ca58154a7d
		fabric-content-registries-v0: Fabric Content Registries (v0) 0.2.1+ca58154a7d
		fabric-crash-report-info-v1: Fabric Crash Report Info (v1) 0.1.3+ca58154a7d
		fabric-dimensions-v1: fabric-dimensions-v1 2.0.2+ca58154a7d
		fabric-entity-events-v1: Fabric Entity Events (v1) 1.0.3+ca58154a7d
		fabric-events-interaction-v0: Fabric Events Interaction (v0) 0.4.2+ca58154a7d
		fabric-events-lifecycle-v0: Fabric Events Lifecycle (v0) 0.2.1+ca58154a7d
		fabric-game-rule-api-v1: Fabric Game Rule API (v1) 1.0.6+ca58154a7d
		fabric-item-api-v1: Fabric Item API (v1) 1.2.1+ca58154a7d
		fabric-item-groups-v0: Fabric Item Groups (v0) 0.2.3+ca58154a7d
		fabric-key-binding-api-v1: Fabric Key Binding API (v1) 1.0.2+ca58154a7d
		fabric-keybindings-v0: Fabric Key Bindings (v0) 0.2.1+ca58154a7d
		fabric-lifecycle-events-v1: Fabric Lifecycle Events (v1) 1.2.1+ca58154a7d
		fabric-loot-tables-v1: Fabric Loot Tables (v1) 1.0.2+ca58154a7d
		fabric-mining-levels-v0: Fabric Mining Levels (v0) 0.1.3+ca58154a7d
		fabric-models-v0: Fabric Models (v0) 0.2.1+ca58154a7d
		fabric-networking-api-v1: Fabric Networking API (v1) 1.0.1+ca58154a7d
		fabric-networking-blockentity-v0: Fabric Networking Block Entity (v0) 0.2.8+ca58154a7d
		fabric-networking-v0: Fabric Networking (v0) 0.3.2+ca58154a7d
		fabric-object-builder-api-v1: Fabric Object Builder API (v1) 1.9.3+ca58154a7d
		fabric-object-builders-v0: Fabric Object Builders (v0) 0.7.2+ca58154a7d
		fabric-particles-v1: Fabric Particles (v1) 0.2.4+ca58154a7d
		fabric-registry-sync-v0: Fabric Registry Sync (v0) 0.7.4+ca58154a7d
		fabric-renderer-api-v1: Fabric Renderer API (v1) 0.4.1+ca58154a7d
		fabric-renderer-indigo: Fabric Renderer - Indigo 0.4.4+ca58154a7d
		fabric-renderer-registries-v1: Fabric Renderer Registries (v1) 2.2.1+ca58154a7d
		fabric-rendering-data-attachment-v1: Fabric Rendering Data Attachment (v1) 0.1.5+ca58154a7d
		fabric-rendering-fluids-v1: Fabric Rendering Fluids (v1) 0.1.13+ca58154a7d
		fabric-rendering-v0: Fabric Rendering (v0) 1.1.2+ca58154a7d
		fabric-rendering-v1: Fabric Rendering (v1) 1.5.1+ca58154a7d
		fabric-resource-loader-v0: Fabric Resource Loader (v0) 0.4.2+ca58154a7d
		fabric-screen-api-v1: Fabric Screen API (v1) 1.0.0+c045166c7d
		fabric-screen-handler-api-v1: Fabric Screen Handler API (v1) 1.1.1+ca58154a7d
		fabric-structure-api-v1: Fabric Structure API (v1) 1.1.4+ca58154a7d
		fabric-tag-extensions-v0: Fabric Tag Extensions (v0) 1.1.1+ca58154a7d
		fabric-textures-v0: Fabric Textures (v0) 1.0.6+ca58154a7d
		fabric-tool-attribute-api-v1: Fabric Tool Attribute API (v1) 1.2.6+ca58154a7d
		fabricloader: Fabric Loader 0.11.1
		hydrogen: Hydrogen 0.2
		java: Java HotSpot(TM) 64-Bit Server VM 8
		krypton: Krypton 0.1.1
		lazydfu: LazyDFU 0.1.1
		lithium: Lithium 0.6.3
		minecraft: Minecraft 1.16.5
		phosphor: Phosphor 0.7.0+build.10
		servertick: Server Tick 1.3
		sodium: Sodium 0.1.0
	Launched Version: fabric-loader-0.11.1-1.16.5
	Backend library: LWJGL version 3.2.2 build 10
	Backend API: GeForce RTX 3070/PCIe/SSE2 GL version 4.6.0 NVIDIA 460.89, 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)
	Graphics mode: fabulous
	Resource Packs: vanilla, Fabric Mods
	Current Language: English (US)
	CPU: 12x Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz

Thank you for the report.
This can be reproduced as follows:

  1. Open TPS graph on a server (alt+F3)
  2. Disconnect from the server
  3. Press F3 in the menu

I have a vague memory of already having fixed this, but clearly, it is not fixed, so it was probably only something similar or I am just misremembering. I'll have a look at it.

This is fixed in 656b3e4. Since I switched to the new fabric networking API in the previous commit, I need to do some testing first, and then I will push version 1.4 with both the update and the fix. Version 1.4 will be compatible with 1.3 despite the API switch.

Ok thanks for fixing it. I appreciate the response. 👍