Package net.gcnt.additionsplus.api.utils
Interface AdditionsAnimation
public interface AdditionsAnimation
Additions Animation.
Contains all information about an animation, used for tablists and other periodically updated text.
- Since:
- 1.0.3
-
Method Summary
Modifier and TypeMethodDescriptionGet the current frame value of this animation.int
Get the current frame index of this animation.Get all frames of this animation.getId()
Get the unique identifier of this animation.int
Get the update interval.Get the optional action that is executed when the animation is updated.boolean
isStatic()
Whether this animation is static text or an animation.void
Select the next frame of the animation.void
setCurrentFrameIndex
(int index) Set the current frame of the animation.void
setInterval
(int interval) Set the update interval of this animation.void
setOnUpdate
(Consumer<AdditionsAnimation> consumer) Set the optional action that is executed when the animation is updated.
-
Method Details
-
getId
String getId()Get the unique identifier of this animation.- Returns:
- The unique identifier of this animation.
-
getFrames
Get all frames of this animation. -
isStatic
boolean isStatic()Whether this animation is static text or an animation. Static text is a single frame, while an animation is a list of frames.- Returns:
- True if this animation is static, false otherwise.
-
getInterval
int getInterval()Get the update interval.- Returns:
- Update interval in ticks.
-
setInterval
void setInterval(int interval) Set the update interval of this animation.- Parameters:
interval
- New update interval in ticks.
-
getCurrentFrame
String getCurrentFrame()Get the current frame value of this animation.- Returns:
- The current frame value.
-
getCurrentFrameIndex
int getCurrentFrameIndex()Get the current frame index of this animation.- Returns:
- The current frame index.
-
setCurrentFrameIndex
void setCurrentFrameIndex(int index) Set the current frame of the animation.- Parameters:
index
- New frame index.
-
nextFrame
void nextFrame()Select the next frame of the animation. -
setOnUpdate
Set the optional action that is executed when the animation is updated.- Parameters:
consumer
- The action to execute.
-
getOnUpdate
Consumer<AdditionsAnimation> getOnUpdate()Get the optional action that is executed when the animation is updated.
-