Class SpellComponent
java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellPart
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellComponent
- Direct Known Subclasses:
SpellComponent.CastBlock, SpellComponent.CastBoth, SpellComponent.CastEntity
Represents a spell component. Components are part of the SpellGrammar.
Extend this class directly for target-independent effects, e.g. time or weather components. Extend one of the inner subclasses for target-dependent effects instead.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a spell component that only affects blocks.static classRepresents a spell component that affects both blocks and entities, with distinct effects on each.static classRepresents a spell component that only affects entities. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SpellComponentCastResultcast(List<SpellModifier> modifiers, SpellCastContext context) Casts the part.getStats()If the spell part is a modifier, returns theSpellStats the modifier modifies.final booleanfinal booleanfinal booleanfinal booleanvoidspawnParticles(List<SpellModifier> modifiers, SpellCastContext context) Spawns particles for the part.Methods inherited from class SpellPart
getData, getData, getDataComponentType, isShape
-
Constructor Details
-
SpellComponent
-
-
Method Details
-
isPrimaryShape
public final boolean isPrimaryShape()- Specified by:
isPrimaryShapein classSpellPart- Returns:
- Whether the spell part is a primary shape.
-
isSecondaryShape
public final boolean isSecondaryShape()- Specified by:
isSecondaryShapein classSpellPart- Returns:
- Whether the spell part is a secondary shape.
-
isComponent
public final boolean isComponent()- Specified by:
isComponentin classSpellPart- Returns:
- Whether the spell part is a component.
-
isModifier
public final boolean isModifier()- Specified by:
isModifierin classSpellPart- Returns:
- Whether the spell part is a modifier.
-
getStats
-
cast
public abstract SpellComponentCastResult cast(List<SpellModifier> modifiers, SpellCastContext context) Casts the part.- Parameters:
modifiers- TheSpellModifiers to consider.context- TheSpellCastContextto use.- Returns:
- A
SpellComponentCastResultrepresenting the result of the cast.
-
spawnParticles
Spawns particles for the part. May only be called on the client.- Parameters:
modifiers- TheSpellModifiers to consider.context- TheSpellCastContextto use.
-