Interface TagSerializer<T>

Type Parameters:
T - the type to serialize

public interface TagSerializer<T>
Interface used to create custom tags.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TagSerializer<org.jglrxavpok.hephaistos.nbt.NBTCompound>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> TagSerializer<T>
    fromCompound(@NotNull Function<org.jglrxavpok.hephaistos.nbt.NBTCompound,T> reader, @NotNull Function<T,org.jglrxavpok.hephaistos.nbt.NBTCompound> writer)
     
    read(@NotNull TagReadable reader)
    Reads the custom tag from a TagReadable.
    void
    write(@NotNull TagWritable writer, T value)
    Writes the custom tag to a TagWritable.
  • Field Details

    • COMPOUND

      @Experimental static final TagSerializer<org.jglrxavpok.hephaistos.nbt.NBTCompound> COMPOUND
  • Method Details

    • read

      @Nullable T read(@NotNull @NotNull TagReadable reader)
      Reads the custom tag from a TagReadable.
      Parameters:
      reader - the reader
      Returns:
      the deserialized value, null if invalid
    • write

      void write(@NotNull @NotNull TagWritable writer, @NotNull T value)
      Writes the custom tag to a TagWritable.
      Parameters:
      writer - the writer
      value - the value to serialize
    • fromCompound

      @Experimental static <T> TagSerializer<T> fromCompound(@NotNull @NotNull Function<org.jglrxavpok.hephaistos.nbt.NBTCompound,T> reader, @NotNull @NotNull Function<T,org.jglrxavpok.hephaistos.nbt.NBTCompound> writer)