This is in 24w12a Snapshot
I have a mod with an item that stored data in the itemstack nbt. Since that is not possible (directly), in 1.20.5+ I re-wrote my item class to use DataComponentTypes.CUSTOM_DATA to store an NbtComponent, which contains an NbtCompound (is there a better way?).
This class works in game and fulfills the functional requirements intended, but I am unsure if this is the most effective way to do it and whether there are any safety issues with my code.
I would appreciate anyone familiar with DataComponentTypes to give my code a review and note any suggestions or potential issues.
Thank you in advance.
https://gist.github.com/kwpugh/4ecc0d9addb35186f54391a79f6f1b74