You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
@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.
@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:
NBTEndan object, since it only needs one instance and doesn't ever need to be copied.EMPTYconstant forNBTCompound, which is an immutable compound with an empty backing map. Also add one forNBTList, which is an immutable list with elements of typeTAG_Endbacked by an empty list.ONEandZEROconstants forNBTByte, which are both immutable with backing values of 1 and 0 respectively (for easier boolean conversions).getBoolean/setBoolean.defaultvalue, 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.NBTListandNBTCompoundthat accept lists and maps respectively, for easier construction.NBTCompoundand the backing list of anNBTListin some way, whether this be an immutable copy, or just the actual map itself.NBTReaderandNBTWriterwith aPathobject as well as with aFile.getOrElseandgetOrNullon anNBTList. Would probably be better ifNBTListjust implementedList<Tag>instead ofIterable<Tag>.Hope this helps you keep track of everything!