接口 IAttachmentSerializer<T>

类型参数:
T - The type of the data attachment.

public interface IAttachmentSerializer<T>
Serializer for data attachments.
  • 方法概要

    修饰符和类型
    方法
    说明
    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.
  • 方法详细资料

    • read

      T read(IAttachmentHolder holder, ValueInput input)
      Reads the attachment from NBT.
      参数:
      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.