Class IotaType<T extends Iota>
java.lang.Object
at.petrak.hexcasting.api.casting.iota.IotaType<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intcolor()Get the color associated with this datum type.static Iotadeserialize(net.minecraft.nbt.CompoundTag tag, net.minecraft.server.level.ServerLevel world) Attempt to deserialize an iota from a tag.abstract Tdeserialize(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.Componentdisplay(net.minecraft.nbt.Tag tag) Get a display of this datum from thedatatag, without the world.static intgetColor(net.minecraft.nbt.CompoundTag tag) static net.minecraft.network.chat.ComponentgetDisplay(net.minecraft.nbt.CompoundTag tag) static net.minecraft.util.FormattedCharSequencegetDisplayWithMaxWidth(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 thetypekey.static booleanisTooLargeToSerialize(Iterable<Iota> examinee) static net.minecraft.nbt.CompoundTagnet.minecraft.network.chat.ComponenttypeName()Get a display component that's the name of this iota type.
-
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
typekey is given when registering the spell datum type; this method deserializes the tag associated with"datum".Returning
nullmakes the resulting datum beNullIota. 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 thedatatag, 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
-
isTooLargeToSerialize
-
getTypeFromTag
This method attempts to find the type from thetypekey. Seeserialize(Iota)for the storage format.- Returns:
nullif 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)
-