Interface IAttachmentSerializer<S extends Tag,T>
- Type Parameters:
S- ATagsubclass: the serialized representation.T- The type of the data attachment.
public interface IAttachmentSerializer<S extends Tag,T>
Serializer for data attachments.
The read(IAttachmentHolder, Tag, HolderLookup.Provider) method must be implemented by subclasses!
-
Method Summary
Modifier and TypeMethodDescriptionread(IAttachmentHolder holder, S tag, HolderLookup.Provider provider) Reads the attachment from NBT.write(T attachment, HolderLookup.Provider provider) Writes the attachment to NBT, or returns null if it is should not be serialized.
-
Method Details
-
read
Reads the attachment from NBT.- Parameters:
holder- the holder for the attachment, can be cast if the subtype is knowntag- the serialized attachment
-
write
Writes the attachment to NBT, or returns null if it is should not be serialized.
-