Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

List of proposals for v2 #7

Open
@BomBardyGamer

Description

@BomBardyGamer

@jglrxavpok told me to make an issue with these, for easier tracking, so here we are.

Here's the list of proposals I have for things in v2:

  • Make NBTEnd an object, since it only needs one instance and doesn't ever need to be copied.
  • Add an EMPTY constant for NBTCompound, which is an immutable compound with an empty backing map. Also add one for NBTList, which is an immutable list with elements of type TAG_End backed by an empty list.
  • Add ONE and ZERO constants for NBTByte, which are both immutable with backing values of 1 and 0 respectively (for easier boolean conversions).
  • Allow getting/setting booleans on compounds, with functions such as getBoolean/setBoolean.
  • Add a new method for getting every type from a compound with a default value, and these methods should never return null. For example, getString("my_key", "my_default") would look for a string in the map with the key "my_key", or else it would return "my_default" if no such value was found.
  • Add constructors to NBTList and NBTCompound that accept lists and maps respectively, for easier construction.
  • Expose the backing map of an NBTCompound and the backing list of an NBTList in some way, whether this be an immutable copy, or just the actual map itself.
  • Possibly add a better way to read compound tags, instead of having to construct a new reader and then read and perform an unchecked cast.
  • Add support for ZLIB compression when reading/writing NBT data. For reference, Adventure does this by having a compression type pseudo enum with compress and decompress methods that are implemented in their respective types, perhaps you could do something similar?
  • Support initialising the NBTReader and NBTWriter with a Path object as well as with a File.
  • Support for calls like getOrElse and getOrNull on an NBTList. Would probably be better if NBTList just implemented List<Tag> instead of Iterable<Tag>.

Hope this helps you keep track of everything!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions