Class IotaType<T extends Iota>

java.lang.Object
at.petrak.hexcasting.api.casting.iota.IotaType<T>

public abstract class IotaType<T extends Iota> extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    Get the color associated with this datum type.
    static Iota
    deserialize(net.minecraft.nbt.CompoundTag tag, net.minecraft.server.level.ServerLevel world)
    Attempt to deserialize an iota from a tag.
    abstract T
    deserialize(net.minecraft.nbt.Tag tag, net.minecraft.server.level.ServerLevel world)
    Spell datums are stored as such: { "type": "modid:type", "datum": a_tag }.
    abstract net.minecraft.network.chat.Component
    display(net.minecraft.nbt.Tag tag)
    Get a display of this datum from the data tag, without the world.
    static int
    getColor(net.minecraft.nbt.CompoundTag tag)
     
    static net.minecraft.network.chat.Component
    getDisplay(net.minecraft.nbt.CompoundTag tag)
     
    static net.minecraft.util.FormattedCharSequence
    getDisplayWithMaxWidth(net.minecraft.nbt.CompoundTag tag, int maxWidth, net.minecraft.client.gui.Font font)
     
    static @Nullable IotaType<?>
    getTypeFromTag(net.minecraft.nbt.CompoundTag tag)
    This method attempts to find the type from the type key.
    static boolean
     
    static net.minecraft.nbt.CompoundTag
     
    net.minecraft.network.chat.Component
    Get a display component that's the name of this iota type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IotaType

      public IotaType()
  • Method Details

    • deserialize

      @Nullable public abstract T deserialize(net.minecraft.nbt.Tag tag, net.minecraft.server.level.ServerLevel world) throws IllegalArgumentException
      Spell datums are stored as such: { "type": "modid:type", "datum": a_tag }.

      The type key is given when registering the spell datum type; this method deserializes the tag associated with "datum".

      Returning null makes the resulting datum be NullIota. Throwing an exception raises a mishap.

      Throws:
      IllegalArgumentException
    • display

      public abstract net.minecraft.network.chat.Component display(net.minecraft.nbt.Tag tag)
      Get a display of this datum from the data tag, without the world. This is for use on the client.
    • color

      public abstract int color()
      Get the color associated with this datum type.
    • typeName

      public net.minecraft.network.chat.Component typeName()
      Get a display component that's the name of this iota type.
    • serialize

      public static net.minecraft.nbt.CompoundTag serialize(Iota iota)
    • isTooLargeToSerialize

      public static boolean isTooLargeToSerialize(Iterable<Iota> examinee)
    • getTypeFromTag

      @Nullable public static @Nullable IotaType<?> getTypeFromTag(net.minecraft.nbt.CompoundTag tag)
      This method attempts to find the type from the type key. See serialize(Iota) for the storage format.
      Returns:
      null if it cannot get the type.
    • deserialize

      public static Iota deserialize(net.minecraft.nbt.CompoundTag tag, net.minecraft.server.level.ServerLevel world)
      Attempt to deserialize an iota from a tag.
      Iotas are saved as such: { "type": "hexcasting:atype", "data": {...} }
    • getDisplay

      public static net.minecraft.network.chat.Component getDisplay(net.minecraft.nbt.CompoundTag tag)
    • getDisplayWithMaxWidth

      public static net.minecraft.util.FormattedCharSequence getDisplayWithMaxWidth(net.minecraft.nbt.CompoundTag tag, int maxWidth, net.minecraft.client.gui.Font font)
    • getColor

      public static int getColor(net.minecraft.nbt.CompoundTag tag)