Interface IAttachmentSerializer<S extends Tag,T>

Type Parameters:
S - A Tag subclass: 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 Details

    • read

      T read(IAttachmentHolder holder, S tag, HolderLookup.Provider provider)
      Reads the attachment from NBT.
      Parameters:
      holder - the holder for the attachment, can be cast if the subtype is known
      tag - the serialized attachment
    • write

      @Nullable S write(T attachment, HolderLookup.Provider provider)
      Writes the attachment to NBT, or returns null if it is should not be serialized.