Record Class SpellStack
java.lang.Object
java.lang.Record
com.github.minecraftschurlimods.arsmagicalegacy.api.spell.SpellStack
public record SpellStack(List<ISpellPart> parts, List<com.mojang.datafixers.util.Pair<ISpellPart,List<ISpellModifier>>> partsWithModifiers)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when the spell stack is malformed. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SpellStack>static final SpellStack -
Constructor Summary
ConstructorsConstructorDescriptionSpellStack(List<ISpellPart> parts, List<com.mojang.datafixers.util.Pair<ISpellPart, List<ISpellModifier>>> partsWithModifiers) Creates an instance of aSpellStackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.booleanisEmpty()static SpellStackof(ISpellPart... parts) Creates a spell stack from a list of parts.static SpellStackof(List<ISpellPart> parts) Creates a spell stack from a list of parts.@UnmodifiableView List<ISpellPart>parts()Returns the value of thepartsrecord component.@UnmodifiableView List<com.mojang.datafixers.util.Pair<ISpellPart,List<ISpellModifier>>> Returns the value of thepartsWithModifiersrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
EMPTY
-
-
Constructor Details
-
SpellStack
public SpellStack(List<ISpellPart> parts, List<com.mojang.datafixers.util.Pair<ISpellPart, List<ISpellModifier>>> partsWithModifiers) Creates an instance of aSpellStackrecord class.- Parameters:
parts- the value for thepartsrecord componentpartsWithModifiers- the value for thepartsWithModifiersrecord component
-
-
Method Details
-
of
Creates a spell stack from a list of parts.- Parameters:
parts- The list of parts to create the spell stack from.- Returns:
- The newly created spell stack.
- Throws:
ShapeGroup.MalformedShapeGroupException- If a modifier is the first element of the parts list.SpellStack.MalformedSpellStackException
-
of
Creates a spell stack from a list of parts.- Parameters:
parts- The list of parts to create the spell stack from.- Returns:
- The newly created spell stack.
- Throws:
ShapeGroup.MalformedShapeGroupException- If a modifier is the first element of the parts list.SpellStack.MalformedSpellStackException
-
parts
Returns the value of thepartsrecord component.- Returns:
- the value of the
partsrecord component
-
partsWithModifiers
@Contract(pure=true) public @UnmodifiableView List<com.mojang.datafixers.util.Pair<ISpellPart,List<ISpellModifier>>> partsWithModifiers()Returns the value of thepartsWithModifiersrecord component.- Returns:
- the value of the
partsWithModifiersrecord component
-
isEmpty
public boolean isEmpty()- Returns:
- Whether this spell stack is empty or not.
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
-