Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bossbar plugin breaks server switching in Minecraft 1.21.1 #40

Open
rickiewars opened this issue Sep 21, 2024 · 3 comments
Open

Bossbar plugin breaks server switching in Minecraft 1.21.1 #40

rickiewars opened this issue Sep 21, 2024 · 3 comments

Comments

@rickiewars
Copy link

I'm just starting out with this repository and have no experience with Go yet.
After some configuring, I got the following error when switching from one server to another (server s2).
I don't realy need the boss plugin but thought I'd share my findings hoping it is of some use to you.
All other plugins work fine in my configuration.

Client: Minecraft 1.21.1
Server (1 & 2): Quilt for Minecraft 1.21.1 with fabric-proxy-lite mod to allow gate to work
Proxy debug log:

2024-09-21 09:05:43 2024-09-21T07:05:43.089Z    DEBUG   java.client.server      netmc/connection.go:478update state    {"previous": "Config", "new": "Play"}
2024-09-21 09:05:43 2024-09-21T07:05:43.089Z    DEBUG   java.client.server.SetActiveSessionHandler    netmc/connection.go:577  set session handler     {"state": "Play", "handler": "*proxy.backendTransitionSessionHandler"}
2024-09-21 09:05:43 2024-09-21T07:05:43.095Z    LEVEL(-2)       java.client.server.decoder      codec/decoder.go:97    decoded packet  {"context": "PacketContext:direction=ClientBound,Protocol=767,KnownPacket=true,PacketID=2b,PacketType=*packet.JoinGame,Payloadlen=136"}
2024-09-21 09:05:43 2024-09-21T07:05:43.095Z    DEBUG   java.client.server      netmc/connection.go:256update auto reading     {"enabled": false}
2024-09-21 09:05:43 2024-09-21T07:05:43.095Z    INFO    java.client.player.serverConn.backendTransitionSession proxy/session_backend_transition.go:219 player joining initial server   {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "serverName": "s2", "serverAddr": "minecraft2:25565"}
2024-09-21 09:05:43 2024-09-21T07:05:43.095Z    DEBUG   java.client.player.serverConn.backendTransitionSession proxy/session_backend_transition.go:258 waiting for client play session handler to be set     {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "serverName": "s2", "serverAddr": "minecraft2:25565"}
2024-09-21 09:05:43 2024-09-21T07:05:43.195Z    DEBUG   java.client.player.serverConn.backendTransitionSession proxy/session_backend_transition.go:258 waiting for client play session handler to be set     {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "serverName": "s2", "serverAddr": "minecraft2:25565"}
2024-09-21 09:05:43 2024-09-21T07:05:43.208Z    DEBUG   java.client     netmc/connection.go:315 queued packet  {"packet": "*bossbar.BossBar"}
2024-09-21 09:05:43 2024-09-21T07:05:43.208Z    DEBUG   java.client     netmc/connection.go:315 queued packet  {"packet": "*bossbar.BossBar"}
2024-09-21 09:05:43 2024-09-21T07:05:43.296Z    DEBUG   java.client.player.serverConn.backendTransitionSession proxy/session_backend_transition.go:258 waiting for client play session handler to be set     {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "serverName": "s2", "serverAddr": "minecraft2:25565"}
2024-09-21 09:05:43 2024-09-21T07:05:43.325Z    LEVEL(-2)       java.client.decoder     codec/decoder.go:97    decoded packet  {"context": "PacketContext:direction=ServerBound,Protocol=767,KnownPacket=true,PacketID=3,PacketType=*config.FinishedUpdate,Payloadlen=1"}
2024-09-21 09:05:43 2024-09-21T07:05:43.325Z    LEVEL(-2)       java.client.encoder     codec/encoder.go:100   encoded packet  {"context": "PacketContext:direction=ClientBound,Protocol=767,KnownPacket=true,PacketID=a,PacketType=*bossbar.BossBar,Payloadlen=0", "bytes": 22}
2024-09-21 09:05:43 2024-09-21T07:05:43.325Z    LEVEL(-2)       java.client.encoder     codec/encoder.go:100   encoded packet  {"context": "PacketContext:direction=ClientBound,Protocol=767,KnownPacket=true,PacketID=a,PacketType=*bossbar.BossBar,Payloadlen=0", "bytes": 126}
2024-09-21 09:05:43 2024-09-21T07:05:43.325Z    DEBUG   java.client     netmc/connection.go:478 update state   {"previous": "Config", "new": "Play"}
2024-09-21 09:05:43 2024-09-21T07:05:43.325Z    DEBUG   java.client.SetActiveSessionHandler     netmc/connection.go:577        set session handler     {"state": "Play", "handler": "*proxy.clientPlaySessionHandler"}
2024-09-21 09:05:43 2024-09-21T07:05:43.375Z    DEBUG   java.client.reader      netmc/reader.go:64    error reading packet, closing connection {"error": "error reading packet frame: error reading varint: EOF"}
2024-09-21 09:05:43 2024-09-21T07:05:43.375Z    DEBUG   java.client.server      netmc/connection.go:256update auto reading     {"enabled": true}
2024-09-21 09:05:43 2024-09-21T07:05:43.375Z    INFO    java.client.player      netmc/connection.go:379player has disconnected {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "sessionHandler": "*proxy.clientPlaySessionHandler"}
2024-09-21 09:05:43 2024-09-21T07:05:43.375Z    DEBUG   java.client     netmc/connection.go:256 update auto reading    {"enabled": true}
2024-09-21 09:05:43 2024-09-21T07:05:43.375Z    DEBUG   java.client.player      proxy/switch.go:161   could not connect player to server       {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "serverName": "s2", "serverAddr": "minecraft2:25565", "error": "unexpectedly disconnected from remote server"}
2024-09-21 09:05:43 2024-09-21T07:05:43.396Z    ERROR   java.client.player.serverConn.backendTransitionSession proxy/session_backend_transition.go:169 unable to switch player to new server, disconnecting  {"name": "rickiewars", "id": "2e19cf2c-ae8d-4218-b5c1-8b91189f1f0c", "serverName": "s2", "serverAddr": "minecraft2:25565", "error": "server connection is no longer active"}
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/proxy.(*backendTransitionSessionHandler).handleJoinGame.func1
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/proxy/session_backend_transition.go:169
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/proxy.(*backendTransitionSessionHandler).handleJoinGame
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/proxy/session_backend_transition.go:247
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/proxy.(*backendTransitionSessionHandler).HandlePacket
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/proxy/session_backend_transition.go:83
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/netmc.(*minecraftConn).startReadLoop.func2
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/netmc/connection.go:228
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/netmc.(*minecraftConn).startReadLoop.func3
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/netmc/connection.go:235
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/netmc.(*minecraftConn).startReadLoop.func4
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/netmc/connection.go:243
2024-09-21 09:05:43 go.minekube.com/gate/pkg/edition/java/netmc.(*minecraftConn).startReadLoop
2024-09-21 09:05:43     /go/pkg/mod/go.minekube.com/gate@v0.40.0/pkg/edition/java/netmc/connection.go:248

Client crash log:

---- Minecraft Network Protocol Error Report ----
// 404

Time: 2024-09-21 09:18:26
Description: Packet handling error

java.lang.NullPointerException: Cannot invoke "net.minecraft.class_345.method_5408(float)" because the return value of "java.util.Map.get(Object)" is null
	at net.minecraft.class_337$1.method_34100(class_337.java:123)
	at net.minecraft.class_2629$class_5885.method_34106(class_2629.java:216)
	at net.minecraft.class_2629.method_34091(class_2629.java:91)
	at net.minecraft.class_337.method_1795(class_337.java:110)
	at net.minecraft.class_634.method_11078(class_634.java:1855)
	at net.minecraft.class_2629.method_11330(class_2629.java:87)
	at net.minecraft.class_2629.method_11054(class_2629.java:14)
	at net.minecraft.class_2600.method_11072(class_2600.java:27)
	at net.minecraft.class_1255.method_18859(class_1255.java:162)
	at net.minecraft.class_4093.method_18859(class_4093.java:23)
	at net.minecraft.class_1255.method_16075(class_1255.java:136)
	at net.minecraft.class_1255.method_5383(class_1255.java:121)
	at net.minecraft.class_310.method_1523(class_310.java:1240)
	at net.minecraft.class_310.method_1514(class_310.java:882)
	at net.minecraft.client.main.Main.main(Main.java:256)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.quiltmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:557)
	at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:84)
	at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:28)


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_337$1.method_34100(class_337.java:123)
	at net.minecraft.class_2629$class_5885.method_34106(class_2629.java:216)
	at net.minecraft.class_2629.method_34091(class_2629.java:91)
	at net.minecraft.class_337.method_1795(class_337.java:110)

-- Incoming Packet --
Details:
	Type: clientbound/minecraft:boss_event
	Is Terminal: false
	Is Skippable: false
Stacktrace:
	at net.minecraft.class_2600.method_59803(class_2600.java:56)
	at net.minecraft.class_8673.method_60882(class_8673.java:136)
	at net.minecraft.class_8673.method_59807(class_8673.java:113)
	at net.minecraft.class_2600.method_11072(class_2600.java:32)
	at net.minecraft.class_1255.method_18859(class_1255.java:162)
	at net.minecraft.class_4093.method_18859(class_4093.java:23)
	at net.minecraft.class_1255.method_16075(class_1255.java:136)
	at net.minecraft.class_1255.method_5383(class_1255.java:121)
	at net.minecraft.class_310.method_1523(class_310.java:1240)
	at net.minecraft.class_310.method_1514(class_310.java:882)
	at net.minecraft.client.main.Main.main(Main.java:256)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.quiltmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:557)
	at org.quiltmc.loader.impl.launch.knot.Knot.launch(Knot.java:84)
	at org.quiltmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:28)

-- Connection --
Details:
	Protocol: play
	Flow: CLIENTBOUND
	Server type: OTHER
	Server brand: quilt (Gate by Minekube)

-- System Details --
Details:
	Minecraft Version: 1.21.1
	Minecraft Version ID: 1.21.1
	Operating System: Windows 11 (amd64) version 10.0
	Java Version: 21.0.3, Microsoft
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft
	Memory: 221850816 bytes (211 MiB) / 1006632960 bytes (960 MiB) up to 4294967296 bytes (4096 MiB)
	CPUs: 16
	Processor Vendor: GenuineIntel
	Processor Name: 12th Gen Intel(R) Core(TM) i5-12600K
	Identifier: Intel64 Family 6 Model 151 Stepping 2
	Microarchitecture: Alder Lake
	Frequency (GHz): 3.69
	Number of physical packages: 1
	Number of physical CPUs: 10
	Number of logical CPUs: 16
	Graphics card #0 name: Intel(R) UHD Graphics 770
	Graphics card #0 vendor: Intel Corporation
	Graphics card #0 VRAM (MiB): 1024.00
	Graphics card #0 deviceId: VideoController1
	Graphics card #0 versionInfo: 31.0.101.4577
	Graphics card #1 name: NVIDIA GeForce RTX 3070 Ti
	Graphics card #1 vendor: NVIDIA
	Graphics card #1 VRAM (MiB): 8192.00
	Graphics card #1 deviceId: VideoController2
	Graphics card #1 versionInfo: 31.0.15.3141
	Graphics card #2 name: NVIDIA GeForce RTX 3070 Ti
	Graphics card #2 vendor: NVIDIA
	Graphics card #2 VRAM (MiB): 8192.00
	Graphics card #2 deviceId: VideoController3
	Graphics card #2 versionInfo: 32.0.15.6109
	Memory slot #0 capacity (MiB): 8192.00
	Memory slot #0 clockSpeed (GHz): 3.47
	Memory slot #0 type: DDR4
	Memory slot #1 capacity (MiB): 8192.00
	Memory slot #1 clockSpeed (GHz): 3.47
	Memory slot #1 type: DDR4
	Memory slot #2 capacity (MiB): 8192.00
	Memory slot #2 clockSpeed (GHz): 3.47
	Memory slot #2 type: DDR4
	Memory slot #3 capacity (MiB): 8192.00
	Memory slot #3 clockSpeed (GHz): 3.47
	Memory slot #3 type: DDR4
	Virtual memory max (MiB): 44826.58
	Virtual memory used (MiB): 27937.98
	Swap memory total (MiB): 12288.00
	Swap memory used (MiB): 168.36
	Space in storage for jna.tmpdir (MiB): available: 248296.92, total: 1906918.00
	Space in storage for org.lwjgl.system.SharedLibraryExtractPath (MiB): available: 248296.92, total: 1906918.00
	Space in storage for io.netty.native.workdir (MiB): available: 248296.92, total: 1906918.00
	Space in storage for java.io.tmpdir (MiB): available: 248296.92, total: 1906918.00
	Space in storage for workdir (MiB): available: 248296.92, total: 1906918.00
	JVM Flags: 10 total; -Xmx4096M -XX:MetaspaceSize=256M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M

If you need more information like my config.yaml or server configs, please let me know.

@NixNux123
Copy link

Hey, thanks for your report and sorry for the really late response.

I can reproduce the issue with paper 1.21.1 as well, we're looking into it right now.
What's interesting though is that when I use 1.20.4 or lower on my client, I can switch servers. Only the shared bossbar disappears then 🤷.

@robinbraemer
Copy link
Member

I think we had to use a later event or add a small sleep before sending the boss bar.

@rickiewars
Copy link
Author

It's bin a while so I'm not sure what I found out during troubleshooting but I may have thought a similar thing as well. Usually I start a small timer which triggers after e.g. 10 ms or I use a function equivalent to Vue3 's NextTick function.

Good luck and thank you for addressing the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants