Interface CompoundTagSerializer<T>

Type Parameters:
T - The value type.

public interface CompoundTagSerializer<T>
A serializer for type T which should define the functionality needed to serialize and deserialize a value of type T to and from a compound tag respectively.
  • Method Summary

    Modifier and Type
    Method
    Description
    copy(T original)
    Should (possibly deep-) clone the object to be used in Tag.copy().
    read(net.minecraft.nbt.CompoundTag tag)
    Should read a value of type T from the provided input tag.
    void
    write(net.minecraft.nbt.CompoundTag tag, T v)
    Should write the provided value into the provided output tag.
  • Method Details

    • write

      void write(net.minecraft.nbt.CompoundTag tag, T v) throws IOException
      Should write the provided value into the provided output tag.
      Parameters:
      tag - The output tag.
      v - The value.
      Throws:
      IOException
    • read

      T read(net.minecraft.nbt.CompoundTag tag) throws IOException
      Should read a value of type T from the provided input tag.
      Parameters:
      tag - The input tag.
      Returns:
      The value.
      Throws:
      IOException
    • copy

      T copy(T original)
      Should (possibly deep-) clone the object to be used in Tag.copy().
      Parameters:
      original - The original object.
      Returns:
      The clone.