Class SpellPart

java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellPart
Direct Known Subclasses:
PrimarySpellShape, SecondarySpellShape, SpellComponent, SpellModifier

public abstract sealed class SpellPart extends Object permits PrimarySpellShape, SecondarySpellShape, SpellComponent, SpellModifier
Represents a spell part.
  • Constructor Details

    • SpellPart

      public SpellPart()
  • Method Details

    • isShape

      public final boolean isShape()
      Returns:
      Whether the spell part is a shape (primary or secondary).
    • isPrimaryShape

      public abstract boolean isPrimaryShape()
      Returns:
      Whether the spell part is a primary shape.
    • isSecondaryShape

      public abstract boolean isSecondaryShape()
      Returns:
      Whether the spell part is a secondary shape.
    • isComponent

      public abstract boolean isComponent()
      Returns:
      Whether the spell part is a component.
    • isModifier

      public abstract boolean isModifier()
      Returns:
      Whether the spell part is a modifier.
    • getStats

      public abstract Set<SpellStat> getStats()
      If the spell part is a modifier, returns the SpellStats the modifier modifies. Otherwise, returns the SpellStats the spell part uses.
      Returns:
      A Set of SpellStats.
    • getData

      public SpellPartData getData(net.minecraft.core.RegistryAccess registryAccess)
      Parameters:
      registryAccess - The RegistryAccess to use.
      Returns:
      The spell part's datapack-defined data.
    • getData

      public SpellPartData getData(net.minecraft.core.HolderLookup.Provider registries)
      Parameters:
      registries - The HolderLookup.Provider to use.
      Returns:
      The spell part's datapack-defined data.
    • getDataComponentType

      public @Nullable net.minecraft.core.component.DataComponentType<?> getDataComponentType()
      Returns:
      The DataComponentType the spell part uses for additional data storage, or null if it does not use a DataComponentType.