diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/compat/serializer/DisconnectSerializerCompat.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/compat/serializer/DisconnectSerializerCompat.java index f6dca303c..bb9955bb9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/compat/serializer/DisconnectSerializerCompat.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/compat/serializer/DisconnectSerializerCompat.java @@ -20,6 +20,7 @@ public void serialize(ByteBuf buffer, BedrockCodecHelper helper, DisconnectPacke buffer.writeBoolean(packet.isMessageSkipped()); if (!packet.isMessageSkipped()) { helper.writeString(buffer, packet.getKickMessage()); + helper.writeString(buffer, packet.getFilteredMessage()); } } @@ -31,6 +32,9 @@ public void deserialize(ByteBuf buffer, BedrockCodecHelper helper, DisconnectPac packet.setMessageSkipped(buffer.readBoolean()); if (!packet.isMessageSkipped()) { packet.setKickMessage(helper.readString(buffer)); + if (buffer.isReadable()) { // backwards compatibility + packet.setFilteredMessage(helper.readString(buffer)); + } } } }