Been digging around data attachments. Now that data attachments no longer apply to item stacks (since components) and the main concern with item data serialization using codecs was how often item NBT got synced.. can we flatten data attachments to always use codecs?
Some reasoning:
Items no longer use attachments, they use Mojang's components.
Removing or adapting IAttachmentSerializer in favor of always using codecs is less maintenance
Favoring codecs also means not dealing with HolderLookup.Provider in many scenarios -- at least, you'd only deal with that while saving NBT, and that's on AttachmentHolder and things using it
Enabling AttachmentHolder.CODEC support for modder code
Been digging around data attachments. Now that data attachments no longer apply to item stacks (since components) and the main concern with item data serialization using codecs was how often item NBT got synced.. can we flatten data attachments to always use codecs?
Some reasoning:
IAttachmentSerializer
in favor of always using codecs is less maintenanceHolderLookup.Provider
in many scenarios -- at least, you'd only deal with that while saving NBT, and that's onAttachmentHolder
and things using itAttachmentHolder.CODEC
support for modder codeExample of a pain point: https://github.com/CompactMods/CompactMachines/blob/83ef9a0daa6162b27d51cd859a39bcdb3fc0621e/neoforge-main/src/main/java/dev/compactmods/machines/data/room/RoomDataAttachments.java#L24-L33