Skip to content

Conversation

@tal5
Copy link
Contributor

@tal5 tal5 commented Jul 9, 2025

Adds CompoundBinaryTag#createBuilder, which creates a builder from the compound tag's current contents.
This is useful if you're editing a couple of values at once, like compound.createBuilder().putInt("num", 6).putString("name", "Timothy").remove("old_value").build().

Might have merge conflicts with #1264, but I'll fix up whichever one is merged last.

@kashike
Copy link
Member

kashike commented Aug 13, 2025

Prefer CompoundBinaryTag.builder(existingTag)

@tal5
Copy link
Contributor Author

tal5 commented Aug 26, 2025

Prefer CompoundBinaryTag.builder(existingTag)

Switched to that style, with a new CompoundBinaryTag#asMap method (returns an unmodifiable view of the tag's contents as a map) for a cleaner implementation without casting to the impl type or other approaches - that method is nice to have either way imo, for more convenient usage with any general map utility methods.

@tal5 tal5 changed the title feature(nbt): CompoundBinaryTag#createBuilder feature(nbt): CompoundBinaryTag#builder(existing) Sep 4, 2025
@kezz kezz added this to the 4.26.0 milestone Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants