GeyserMC / MCProtocolLib

A library for communication with a Minecraft client/server.
MIT License
725 stars 201 forks source link

This is what happens if you join a server with music in a jukebox playing: io.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: Value -1 has no mapping for key class #537

Closed H4xX0r1337 closed 4 years ago

H4xX0r1337 commented 4 years ago

Not much to say, it just disconnects with with the following cause: https://pastebin.com/n5NgRDr5

H4xX0r1337 commented 4 years ago

It seems like it might not be the musics fault, the server is skyblock.net and I found this hotfix (Kotlin):

val values = MagicValues::class.java.getDeclaredField("VALUES").apply { isAccessible = true }.get(null) as MutableMap<Any, List<Any>>
values[BuiltinSound.AMBIENT_CAVE] = listOf(-1)
H4xX0r1337 commented 4 years ago

@Steveice10 yes, latest (when i tested it) Maybe a server sent an invalid sound id to crash bots? The official Client has no problem with it. I really though it was the jukebox but it seems like it isn't the problem

H4xX0r1337 commented 4 years ago

@Steveice10 Huge thanks for fixing this. I noticed that I no longer get this issue without changing anything (except removing the hotfix). Is it handled by default now or did the server itself change it?