fix: properly return missing optvarint

This commit is contained in:
mworzala 2024-04-23 23:20:27 -04:00
parent f76d421744
commit 129fd8ca0f
No known key found for this signature in database
GPG Key ID: B148F922E64797C7
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ public final class Metadata {
@Override
public Integer read(@NotNull NetworkBuffer buffer) {
return buffer.read(NetworkBuffer.VAR_INT) - 1;
int value = buffer.read(NetworkBuffer.VAR_INT);
return value == 0 ? null : value - 1;
}
});
}