Package com.destroystokyo.paper
Class Title.Builder
java.lang.Object
com.destroystokyo.paper.Title.Builder
- Enclosing class:
- Title
A builder for creating titles
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a title based on the values in the builder.fadeIn
(int fadeIn) Sets the number of ticks for the title to fade infadeOut
(int fadeOut) Sets the number of ticks for the title to fade out.stay
(int stay) Sets the number of ticks for the title to stay.Sets the subtitle to the given text.subtitle
(@Nullable BaseComponent subtitle) Sets the subtitle to the given text.subtitle
(@Nullable BaseComponent[] subtitle) Sets the subtitle to the given text.Sets the title to the given text.title
(@NotNull BaseComponent title) Sets the title to the given text.title
(@NotNull BaseComponent[] title) Sets the title to the given text.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
title
Sets the title to the given text.- Parameters:
title
- the title text- Returns:
- this builder instance
- Throws:
NullPointerException
- if the title is null
-
title
Sets the title to the given text.- Parameters:
title
- the title text- Returns:
- this builder instance
- Throws:
NullPointerException
- if the title is null
-
title
Sets the title to the given text.It is recommended to the
BaseComponent
methods.- Parameters:
title
- the title text- Returns:
- this builder instance
- Throws:
NullPointerException
- if the title is null
-
subtitle
Sets the subtitle to the given text.- Parameters:
subtitle
- the title text- Returns:
- this builder instance
-
subtitle
Sets the subtitle to the given text.- Parameters:
subtitle
- the title text- Returns:
- this builder instance
-
subtitle
Sets the subtitle to the given text.It is recommended to the
BaseComponent
methods.- Parameters:
subtitle
- the title text- Returns:
- this builder instance
-
fadeIn
Sets the number of ticks for the title to fade in- Parameters:
fadeIn
- the number of ticks to fade in- Returns:
- this builder instance
- Throws:
IllegalArgumentException
- if it is negative
-
stay
Sets the number of ticks for the title to stay.- Parameters:
stay
- the number of ticks to stay- Returns:
- this builder instance
- Throws:
IllegalArgumentException
- if it is negative
-
fadeOut
Sets the number of ticks for the title to fade out.- Parameters:
fadeOut
- the number of ticks to fade out- Returns:
- this builder instance
- Throws:
IllegalArgumentException
- if it is negative
-
build
Create a title based on the values in the builder.- Returns:
- a title from the values in this builder
- Throws:
IllegalStateException
- if title isn't specified
-