Class SpellComponent.CastBoth
java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellPart
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellComponent
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellComponent.CastBoth
- Enclosing class:
SpellComponent
Represents a spell component that affects both blocks and entities, with distinct effects on each.
-
Nested Class Summary
Nested classes/interfaces inherited from class SpellComponent
SpellComponent.CastBlock, SpellComponent.CastBoth, SpellComponent.CastEntity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncast(List<SpellModifier> modifiers, SpellCastContext context) Casts the part.abstract SpellComponentCastResultcastBlock(List<SpellModifier> modifiers, SpellCastContext context, net.minecraft.world.phys.BlockHitResult hitResult) Casts this part on a block.abstract SpellComponentCastResultcastEntity(List<SpellModifier> modifiers, SpellCastContext context, net.minecraft.world.phys.EntityHitResult hitResult) Casts this part on an entity.Methods inherited from class SpellComponent
getStats, isComponent, isModifier, isPrimaryShape, isSecondaryShape, spawnParticlesMethods inherited from class SpellPart
getData, getData, getDataComponentType, isShape
-
Constructor Details
-
CastBoth
-
-
Method Details
-
cast
Description copied from class:SpellComponentCasts the part.- Specified by:
castin classSpellComponent- Parameters:
modifiers- TheSpellModifiers to consider.context- TheSpellCastContextto use.- Returns:
- A
SpellComponentCastResultrepresenting the result of the cast.
-
castBlock
public abstract SpellComponentCastResult castBlock(List<SpellModifier> modifiers, SpellCastContext context, net.minecraft.world.phys.BlockHitResult hitResult) Casts this part on a block.- Parameters:
modifiers- TheSpellModifiers to consider.context- TheSpellCastContextto use.hitResult- TheBlockHitResultof the spell cast. This is provided for convenience and will be the cast version ofSpellCastContext.hitResult().- Returns:
- A
SpellComponentCastResultrepresenting the result of the cast.
-
castEntity
public abstract SpellComponentCastResult castEntity(List<SpellModifier> modifiers, SpellCastContext context, net.minecraft.world.phys.EntityHitResult hitResult) Casts this part on an entity.- Parameters:
modifiers- TheSpellModifiers to consider.context- TheSpellCastContextto use.hitResult- TheEntityHitResultof the spell cast. This is provided for convenience and will be the cast version ofSpellCastContext.hitResult().- Returns:
- A
SpellComponentCastResultrepresenting the result of the cast.
-