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
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Titlebuild()Create a title based on the values in the builder.@NotNull Title.BuilderfadeIn(int fadeIn) Sets the number of ticks for the title to fade in@NotNull Title.BuilderfadeOut(int fadeOut) Sets the number of ticks for the title to fade out.@NotNull Title.Builderstay(int stay) Sets the number of ticks for the title to stay.@NotNull Title.BuilderSets the subtitle to the given text.@NotNull Title.Buildersubtitle(@Nullable net.md_5.bungee.api.chat.BaseComponent subtitle) Sets the subtitle to the given text.@NotNull Title.Buildersubtitle(@Nullable net.md_5.bungee.api.chat.BaseComponent[] subtitle) Sets the subtitle to the given text.@NotNull Title.BuilderSets the title to the given text.@NotNull Title.Buildertitle(@NotNull net.md_5.bungee.api.chat.BaseComponent title) Sets the title to the given text.@NotNull Title.Buildertitle(@NotNull net.md_5.bungee.api.chat.BaseComponent[] title) Sets the title to the given text.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
title
@NotNull public @NotNull Title.Builder title(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent 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
@NotNull public @NotNull Title.Builder title(@NotNull @NotNull net.md_5.bungee.api.chat.BaseComponent[] 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
BaseComponentmethods.- Parameters:
title- the title text- Returns:
- this builder instance
- Throws:
NullPointerException- if the title is null
-
subtitle
@NotNull public @NotNull Title.Builder subtitle(@Nullable @Nullable net.md_5.bungee.api.chat.BaseComponent subtitle) Sets the subtitle to the given text.- Parameters:
subtitle- the title text- Returns:
- this builder instance
-
subtitle
@NotNull public @NotNull Title.Builder subtitle(@Nullable @Nullable net.md_5.bungee.api.chat.BaseComponent[] 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
BaseComponentmethods.- 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
-