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

ListTag improvements #91

Open
wants to merge 8 commits into
base: nbt7
Choose a base branch
from

Commits on May 31, 2023

  1. Rename ListTag.iterateType to asList

    The implementation of TypedListTag fully supports mutation with the necessary validation checks, so it's purpose isn't just iteration (anymore).
    HoldYourWaffle committed May 31, 2023
    Configuration menu
    Copy the full SHA
    e1673f6 View commit details
    Browse the repository at this point in the history
  2. Decouple ListTag type from emptiness

    There's nothing inherently wrong with a typed but empty list, as long as it's properly serialized.
    Resetting a ListTag's type when it runs empty circumvents pollution checks, meaning a ListTag could (accidentally) change its type, which feels like asking for trouble :)
    HoldYourWaffle committed May 31, 2023
    Configuration menu
    Copy the full SHA
    6a0cb3b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9c30043 View commit details
    Browse the repository at this point in the history
  4. Add ListTag.get*Tag methods

    Git seems to generate a very unfortunate diff for this...
    HoldYourWaffle committed May 31, 2023
    Configuration menu
    Copy the full SHA
    f2f0958 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    67b28fe View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    66770fe View commit details
    Browse the repository at this point in the history
  7. Add ListTag.getNumber

    HoldYourWaffle committed May 31, 2023
    Configuration menu
    Copy the full SHA
    475019e View commit details
    Browse the repository at this point in the history
  8. Implement ListTag constructor with addAll

    De-dupes validation logic.
    Modifying a passed in list circumvented validation. It's still possible to modify a `ListTag` using the `List`-interface via `asList`.
    HoldYourWaffle committed May 31, 2023
    Configuration menu
    Copy the full SHA
    8671fe5 View commit details
    Browse the repository at this point in the history