Correctly retain message buffer for LoginPluginMessage.

Fixes #407
This commit is contained in:
Andrew Steinborn
2020-12-21 13:14:38 -05:00
parent 9c375f337b
commit 98b74fd220

View File

@@ -49,7 +49,7 @@ public class LoginPluginMessage extends DeferredByteBufHolder implements Minecra
this.id = ProtocolUtils.readVarInt(buf);
this.channel = ProtocolUtils.readString(buf);
if (buf.isReadable()) {
this.replace(buf.readSlice(buf.readableBytes()));
this.replace(buf.readRetainedSlice(buf.readableBytes()));
} else {
this.replace(Unpooled.EMPTY_BUFFER);
}