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

[1.21/1.22] Attachment Holders and Codecs #1160

Open
robotgryphon opened this issue Jun 22, 2024 · 1 comment
Open

[1.21/1.22] Attachment Holders and Codecs #1160

robotgryphon opened this issue Jun 22, 2024 · 1 comment
Labels
1.21 Targeted at Minecraft 1.21 enhancement New (or improvement to existing) feature or request request for comments For gathering opinions on some topic or subject

Comments

@robotgryphon
Copy link
Contributor

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

Example 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

@robotgryphon robotgryphon added enhancement New (or improvement to existing) feature or request request for comments For gathering opinions on some topic or subject 1.21 Targeted at Minecraft 1.21 labels Jun 22, 2024
@robotgryphon
Copy link
Contributor Author

Related PR for code discussion and changes: #1163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21 Targeted at Minecraft 1.21 enhancement New (or improvement to existing) feature or request request for comments For gathering opinions on some topic or subject
Projects
None yet
Development

No branches or pull requests

1 participant