Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nbt): expose size in CompoundBinaryTag #965

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ public interface CompoundBinaryTag extends BinaryTag, CompoundTagSetter<Compound
*/
@Nullable BinaryTag get(final String key);

/**
* Gets the size.
RealBauHD marked this conversation as resolved.
Show resolved Hide resolved
*
* @return the size
* @since 4.15.0
*/
int size();

/**
* Gets a boolean.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public boolean contains(final @NotNull String key, final @NotNull BinaryTagType<
return this.tags.get(key);
}

@Override
public int size() {
return this.tags.size();
}

@Override
public @NotNull CompoundBinaryTag put(final @NotNull String key, final @NotNull BinaryTag tag) {
return this.edit(map -> map.put(key, tag));
Expand Down