Interface IAttachmentSerializer<T>
- Type Parameters:
T
- The type of the data attachment.
public interface IAttachmentSerializer<T>
Serializer for data attachments.
-
Method Summary
Modifier and TypeMethodDescriptionread
(IAttachmentHolder holder, ValueInput input) Reads the attachment from NBT.boolean
write
(T attachment, ValueOutput output) Writes the attachment to the value output, or returnsfalse
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 knowninput
- the input to read from
-
write
Writes the attachment to the value output, or returnsfalse
if it is should not be serialized.If
false
is returned, any data written to the value output by this method will be discarded.
-