public class BedrockCompat
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static BedrockCodec |
CODEC
This is for servers when figuring out the protocol of a client joining.
|
static BedrockCodec |
CODEC_v291
A legacy version of the compat codec which does not use DisconnectFailReason in DisconnectPacket.
|
static BedrockCodec |
CODEC_v622
A legacy version of the compat codec which does not use filteredMessage in DisconnectPacket.
|
| Constructor and Description |
|---|
BedrockCompat() |
| Modifier and Type | Method and Description |
|---|---|
static BedrockCodec |
disconnectCompat(int protocolVersion)
Certain older protocols have outdated
DisconnectPacket formats. |
public static BedrockCodec CODEC
disconnectCompat(int) before disconnecting,
in order for the client to see a proper disconnect message.public static BedrockCodec CODEC_v291
public static BedrockCodec CODEC_v622
public static BedrockCodec disconnectCompat(int protocolVersion)
DisconnectPacket formats.
Using the codec provided by this method before disconnecting a client will always
ensure they receive a well-formed DisconnectPacket.
Note that this compat codec should only be used if disconnecting the client upon receiving its protocol version. Otherwise, use a proper codec that targets the specific protocol.
protocolVersion - the client's protocol version