Interface IStoredSpellVar<T>

Type Parameters:
T - the type of value this spell variable holds
All Superinterfaces:
ISpellVar<T>
All Known Implementing Classes:
IStoredSpellVar.StoredSpellVar

public interface IStoredSpellVar<T> extends ISpellVar<T>
Extension of ISpellVar that adds NBT serialization capabilities for persistent storage.

Stored spell variables can be serialized to and deserialized from NBT tags, allowing them to be saved to disk and persist across game sessions.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    IStoredSpellVar.StoredSpellVar<T,E extends net.minecraft.nbt.Tag>
    Default implementation of IStoredSpellVar with NBT serialization support.

    Nested classes/interfaces inherited from interface com.binaris.wizardry.api.content.data.ISpellVar

    ISpellVar.SpellVar<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    read(net.minecraft.nbt.CompoundTag nbt)
    Reads the value from an NBT compound tag.
    void
    write(net.minecraft.nbt.CompoundTag nbt, T value)
    Writes the value to an NBT compound tag for persistent storage.

    Methods inherited from interface com.binaris.wizardry.api.content.data.ISpellVar

    canPurge, isPersistent, isSynced, read, update, write
  • Method Details

    • write

      void write(net.minecraft.nbt.CompoundTag nbt, T value)
      Writes the value to an NBT compound tag for persistent storage.
      Parameters:
      nbt - the NBT compound tag to write to
      value - the value to write
    • read

      T read(net.minecraft.nbt.CompoundTag nbt)
      Reads the value from an NBT compound tag.
      Parameters:
      nbt - the NBT compound tag to read from
      Returns:
      the value read from the tag, or null if no value is present