Class CustomAnimationHandlerSession

java.lang.Object
de.marcely.bedwars.api.cosmetics.animation.custom.CustomAnimationHandlerSession
All Implemented Interfaces:
AnimationHandler

public abstract class CustomAnimationHandlerSession extends Object implements AnimationHandler
Represents a session of when the animation handler shall be played.
  • Constructor Details

  • Method Details

    • handleTick

      public abstract void handleTick(int amount)
      In case the animation has been configured to be "repeated" / "periodic".

      May never be called if the animation hasn't been configured to be repeated, or if CustomAnimationHandlerType.isPeriodic() returns false.

      There's an amount parameter since the configured frequency may be more than 20x per tick.

      Parameters:
      amount - Amount of times it shall play for this tick. Always at least 1
    • handleStop

      public abstract void handleStop()
      Stop everything you do IMMEDIATELY, and undo everything (blocks etc) you had done.

      It's always called if it's supposed to stop, even if you call stop().

    • getInfo

      Get the neccessary information needed to do your thing.
      Returns:
      Neccessary info for this session
    • isActive

      public final boolean isActive()
      Get whether the animation hasn't been stopped yet.
      Returns:
      true if it is still handling stuff
    • stop

      public final void stop()
      Stop the session immediately.