Class CustomAnimationHandlerSession
java.lang.Object
de.marcely.bedwars.api.cosmetics.animation.custom.CustomAnimationHandlerSession
- All Implemented Interfaces:
AnimationHandler
Represents a session of when the animation handler shall be played.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains all the information neccessary for the handler to do its thing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInfo()Get the neccessary information needed to do your thing.abstract voidStop everything you do IMMEDIATELY, and undo everything (blocks etc) you had done.abstract voidhandleTick(int amount) In case the animation has been configured to be "repeated" / "periodic".final booleanisActive()Get whether the animation hasn't been stopped yet.final voidstop()Stop the session immediately.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.marcely.bedwars.api.cosmetics.animation.AnimationHandler
getAnimation, getMaxDurationTicks, getOffsetX, getOffsetY, getOffsetZ, getType, hasOffset
-
Constructor Details
-
CustomAnimationHandlerSession
Call this withinCustomAnimationHandlerType.openSession(SessionInfo)- Parameters:
info- The info you had received from the method prior
-
-
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()returnsfalse.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:
trueif it is still handling stuff
-
stop
public final void stop()Stop the session immediately.
-