Class Iota
java.lang.Object
at.petrak.hexcasting.api.casting.iota.Iota
- Direct Known Subclasses:
BooleanIota,ContinuationIota,DoubleIota,EntityIota,GarbageIota,ListIota,NullIota,PatternIota,Vec3Iota
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdepth()net.minecraft.network.chat.Componentdisplay()booleanReturns whether this iota is possible to execute (i.e.@NotNull at.petrak.hexcasting.api.casting.eval.CastResultexecute(at.petrak.hexcasting.api.casting.eval.vm.CastingVM vm, net.minecraft.server.level.ServerLevel world, at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation continuation) This method is called when this iota is executed (i.e.@NotNull IotaType<?>getType()inthashCode()abstract booleanisTruthy()abstract @NotNull net.minecraft.nbt.TagSerialize this under thedatatag.intsize()This method is called to determine whether the iota is above the max serialisation depth/serialisation count limits.subIotas()This method is called to determine whether the iota is above the max serialisation depth/serialisation count limits.static booleanHelper method to see if either iota tolerates the other.protected abstract booleantoleratesOther(Iota that) Compare this to another object, within a tolerance.static booleantypesMatch(Iota a, Iota b) Helper method to see if two iotas have the same type.
-
Field Details
-
payload
-
type
-
-
Constructor Details
-
Iota
-
-
Method Details
-
getType
-
isTruthy
public abstract boolean isTruthy() -
toleratesOther
Compare this to another object, within a tolerance. -
serialize
@NotNull public abstract @NotNull net.minecraft.nbt.Tag serialize()Serialize this under thedatatag.You probably don't want to call this directly; use
IotaType.serialize(at.petrak.hexcasting.api.casting.iota.Iota). -
execute
@NotNull public @NotNull at.petrak.hexcasting.api.casting.eval.CastResult execute(at.petrak.hexcasting.api.casting.eval.vm.CastingVM vm, net.minecraft.server.level.ServerLevel world, at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation continuation) This method is called when this iota is executed (i.e. Hermes is run on a list containing it, unescaped). By default it will return aCastResultindicating an error has occurred. -
executable
public boolean executable()Returns whether this iota is possible to execute (i.e. whetherexecute(at.petrak.hexcasting.api.casting.eval.vm.CastingVM, net.minecraft.server.level.ServerLevel, at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation)has been overridden. -
subIotas
This method is called to determine whether the iota is above the max serialisation depth/serialisation count limits. It should return every "iota" that is a subelement of this iota. For example, if you implemented a Map<Iota, Iota>, then it should be an iterable over the keys *and* values of the map. If you implemented a typed List<Double> iota for some reason, you should instead overridesize(). -
size
public int size()This method is called to determine whether the iota is above the max serialisation depth/serialisation count limits. This is an alternative to deriving subIotas for if your Iota is a datastructure of variable size over something that doesn't make sense to convert to an Iota iterable, such asContinuationIota, or a typed List<Double>. It should return "1" per "iota sized" unit of memory that it would occupy. Easy option, return the element count of your data structure. -
depth
public int depth() -
display
public net.minecraft.network.chat.Component display() -
typesMatch
Helper method to see if two iotas have the same type. -
tolerates
Helper method to see if either iota tolerates the other. -
hashCode
public int hashCode()
-