mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 02:15:34 -04:00
tab list: ignore invalid gamemodes
Some servers (like play.cubecraft.net) don't send a -1 gamemode. This produces a lot of exceptions and useless errors. Minecraft seems to handle that fine
This commit is contained in:
parent
3c61ee38ac
commit
145feaed42
@ -43,7 +43,7 @@ class TabListS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
|||||||
TabListItemActions.ADD -> {
|
TabListItemActions.ADD -> {
|
||||||
val name = buffer.readString()
|
val name = buffer.readString()
|
||||||
val properties = buffer.readPlayerProperties()
|
val properties = buffer.readPlayerProperties()
|
||||||
val gamemode = Gamemodes[buffer.readVarInt()]
|
val gamemode = Gamemodes.getOrNull(buffer.readVarInt()) ?: Gamemodes.SURVIVAL
|
||||||
val ping = buffer.readVarInt()
|
val ping = buffer.readVarInt()
|
||||||
val hasDisplayName = buffer.readBoolean()
|
val hasDisplayName = buffer.readBoolean()
|
||||||
val displayName = if (hasDisplayName) {
|
val displayName = if (hasDisplayName) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user