Interface IAttachmentSerializer<T>

Type Parameters:
T - The type of the data attachment.

public interface IAttachmentSerializer<T>
Serializer for data attachments.
  • Method Summary

    Modifier and Type
    Method
    Description
    Reads the attachment from NBT.
    boolean
    write(T attachment, ValueOutput output)
    Writes the attachment to the value output, or returns false if it is should not be serialized.
  • Method Details

    • read

      T read(IAttachmentHolder holder, ValueInput input)
      Reads the attachment from NBT.
      Parameters:
      holder - the holder for the attachment, can be cast if the subtype is known
      input - the input to read from
    • write

      boolean write(T attachment, ValueOutput output)
      Writes the attachment to the value output, or returns false if it is should not be serialized.

      If false is returned, any data written to the value output by this method will be discarded.