Class Divination

java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.Divination
Direct Known Subclasses:
ASTROLOGIA, BAO_ZHONG_CHA, CARTOMANCIE, CHARTIA, INTUEOR, MANTEIA_KENTAVROS, OVOGNOSIS

public abstract class Divination extends O2Spell
Super class for all divination spells.
  • Field Details

    • divinationSpells

      public static final List<O2SpellType> divinationSpells
      All divination spell types
  • Constructor Details

    • Divination

      public Divination(Ollivanders2 plugin)
      Default constructor for use in generating spell text. Do not use to cast the spell.
      Parameters:
      plugin - the Ollivanders2 plugin
    • Divination

      public Divination(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Double rightWand)
      Constructor.
      Parameters:
      plugin - a callback to the MC plugin
      player - the player who cast this spell
      rightWand - which wand the player was using
  • Method Details

    • setUsesModifier

      protected void setUsesModifier()
      Override setUsesModifier because this spell does not require holding a wand.
      Overrides:
      setUsesModifier in class O2Spell
    • setTarget

      public void setTarget(@NotNull @NotNull org.bukkit.entity.Player t)
      Set the target for this divination. This must be done when the spell is created.
      Parameters:
      t - the target player
    • checkEffect

      public void checkEffect()
      Description copied from class: O2Spell
      Main game tick update called every server tick while the spell is active.

      Handles core spell lifecycle logic:

      • Validates spell is allowed at current location; kills if not
      • Increments spell lifetime and kills if exceeding max lifetime
      • Moves projectile via O2Spell.move() if projectile hasn't hit a target
      • Executes spell-specific effects via O2Spell.doCheckEffect()

      Subclasses typically override O2Spell.doCheckEffect() instead of this method. Only override this method if you need to customize the spell's entire tick behavior.

      Overrides:
      checkEffect in class O2Spell
    • doCheckEffect

      protected void doCheckEffect()
      Description copied from class: O2Spell
      Spell-specific effects and behavior executed each game tick.

      Called each tick from O2Spell.checkEffect() after validation and movement logic. Subclasses must override this method to implement the spell's unique effects such as damage, block changes, particle effects, or other gameplay mechanics.

      Specified by:
      doCheckEffect in class O2Spell