Use nullable writer

This commit is contained in:
Noel Németh 2022-06-19 03:01:49 +02:00
parent 4c90af572a
commit 6145a9f5e7
1 changed files with 1 additions and 6 deletions

View File

@ -93,11 +93,6 @@ public record LoginStartPacket(@NotNull String username, @Nullable PlayerPublicK
if (username.length() > 16)
throw new IllegalArgumentException("Username is not allowed to be longer than 16 characters");
writer.writeSizedString(username);
if (publicKey == null) {
writer.writeBoolean(false);
} else {
writer.writeBoolean(true);
writer.write(publicKey);
}
writer.writeNullable(publicKey);
}
}