Package me.croabeast.takion.message
Interface TitleManager
public interface TitleManager
Manages the timing and display of titles for players.
A TitleManager controls the timing parameters (fade in, stay, and fade out ticks)
for title messages displayed to players. It provides methods to get and set these tick values,
as well as a builder pattern to conveniently construct and send title messages.
The built-in TitleManager.Builder class allows for fluent customization of title and subtitle messages,
including the configuration of timing and the dispatch of the title to players.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA builder class for configuring and sending title messages to players. -
Method Summary
Modifier and TypeMethodDescriptionCreates a newTitleManager.Builderfor constructing a title message using a single combined message.default TitleManager.BuilderCreates a newTitleManager.Builderfor constructing a title message with the specified title and subtitle.intGets the number of ticks for the title fade-in animation.intGets the number of ticks for the title fade-out animation.intGets the number of ticks that the title remains on screen.voidsetFadeInTicks(int fadeIn) Sets the number of ticks for the title fade-in animation.voidsetFadeOutTicks(int fadeOut) Sets the number of ticks for the title fade-out animation.voidsetStayTicks(int stay) Sets the number of ticks that the title remains on screen.default voidsetTicks(int fadeIn, int stay, int fadeOut) Sets the fade in, stay, and fade out ticks for the title simultaneously.
-
Method Details
-
getFadeInTicks
int getFadeInTicks()Gets the number of ticks for the title fade-in animation.- Returns:
- the fade-in ticks
-
getStayTicks
int getStayTicks()Gets the number of ticks that the title remains on screen.- Returns:
- the stay ticks
-
getFadeOutTicks
int getFadeOutTicks()Gets the number of ticks for the title fade-out animation.- Returns:
- the fade-out ticks
-
setFadeInTicks
void setFadeInTicks(int fadeIn) Sets the number of ticks for the title fade-in animation.- Parameters:
fadeIn- the fade-in ticks (must be ≥ 0)
-
setStayTicks
void setStayTicks(int stay) Sets the number of ticks that the title remains on screen.- Parameters:
stay- the stay ticks (must be > 0)
-
setFadeOutTicks
void setFadeOutTicks(int fadeOut) Sets the number of ticks for the title fade-out animation.- Parameters:
fadeOut- the fade-out ticks (must be ≥ 0)
-
setTicks
default void setTicks(int fadeIn, int stay, int fadeOut) Sets the fade in, stay, and fade out ticks for the title simultaneously.Each parameter is validated: fade-in and fade-out must be non-negative, and stay must be positive. Invalid values are ignored.
- Parameters:
fadeIn- the fade-in ticksstay- the stay ticksfadeOut- the fade-out ticks
-
builder
Creates a newTitleManager.Builderfor constructing a title message with the specified title and subtitle.The builder is pre-populated with the current tick settings from this manager.
- Parameters:
title- the main title textsubtitle- the subtitle text- Returns:
- a new
TitleManager.Builderinstance for creating and sending the title
-
builder
Creates a newTitleManager.Builderfor constructing a title message using a single combined message.The interpretation of a single message is implementation-dependent.
- Parameters:
message- the combined title message- Returns:
- a new
TitleManager.Builderinstance
-