Class ANIMAGUS_INCANTATION

java.lang.Object
net.pottercraft.ollivanders2.effect.O2Effect
net.pottercraft.ollivanders2.effect.ANIMAGUS_INCANTATION

public class ANIMAGUS_INCANTATION extends O2Effect
Temporary marker effect indicating the player is currently reciting the Animagus incantation.

ANIMAGUS_INCANTATION is a temporary effect that marks an active Animagus transformation spell casting session. Unlike ANIMAGUS_EFFECT (which represents the permanent animal form transformation), this effect simply tracks that the player is in the process of reciting the incantation. The duration of this effect corresponds to the time the player has to continue reciting the spell before completion or expiration.

This effect serves as a state marker for spell progression systems and prevents multiple simultaneous incantation attempts. When the incantation is complete (or expires), this effect is removed and may be replaced by an ANIMAGUS_EFFECT if the spell succeeds.

  • Constructor Details

    • ANIMAGUS_INCANTATION

      public ANIMAGUS_INCANTATION(@NotNull @NotNull Ollivanders2 plugin, int duration, boolean isPermanent, @NotNull @NotNull UUID pid)
      Constructor for creating an Animagus incantation marker effect.

      Creates a temporary effect that marks the player as actively reciting the Animagus spell. The duration parameter specifies how long the incantation remains active before expiring.

      Parameters:
      plugin - a callback to the MC plugin
      duration - the duration of the incantation state in game ticks
      isPermanent - ignored - animagus incantation is always temporary
      pid - the unique ID of the player reciting the Animagus incantation
  • Method Details

    • checkEffect

      public void checkEffect()
      Age the incantation effect to track its remaining duration.

      Called every game tick by the effect system. Decrements the effect's duration by 1 tick. When the duration reaches zero or below, the effect is automatically killed and removed.

      Specified by:
      checkEffect in class O2Effect
    • doRemove

      public void doRemove()
      Perform cleanup when the incantation effect is removed.

      The default implementation does nothing, as the incantation marker effect has no state to clean up. Removal of this effect simply ends the incantation state, allowing the player to attempt the spell again or move on to other actions.

      Specified by:
      doRemove in class O2Effect
    • setPermanent

      public void setPermanent(boolean perm)
      Overridden to prevent permanent status - animagus incantation is always temporary.

      ANIMAGUS_INCANTATION enforces non-permanent behavior by ignoring all setPermanent() calls. This effect is designed as a temporary marker for the incantation spell casting state and cannot be converted to permanent status. Attempts to set this effect to permanent are silently ignored.

      Overrides:
      setPermanent in class O2Effect
      Parameters:
      perm - the requested permanent status (ignored - effect remains temporary regardless)