Modifier and Type | Field and Description |
---|---|
protected boolean |
clear |
protected Integer |
fadeIn |
protected Integer |
fadeOut |
protected boolean |
reset |
protected Integer |
stay |
protected Text |
subtitle |
protected Text |
title |
Constructor and Description |
---|
TitleBuilder()
Constructs a new empty
TitleBuilder . |
TitleBuilder(Title title)
Constructs a new
TitleBuilder with the properties of the given
Title as initial values. |
Modifier and Type | Method and Description |
---|---|
Title |
build()
Builds an immutable instance of the current configuration.
|
TitleBuilder |
clear()
Removes the currently displayed title from the player's screen.
|
TitleBuilder |
clear(boolean clear)
Sets whether the the currently displayed title should be removed from the
player's screen and will keep the currently used display times.
|
boolean |
equals(Object o) |
TitleBuilder |
fadeIn(Integer fadeIn)
Sets the duration in ticks of the fade in effect of the title.
|
TitleBuilder |
fadeOut(Integer fadeOut)
Sets the duration in ticks of the fade out effect of the title.
|
Optional<Integer> |
getFadeIn()
Returns the current fade in effect time of the title.
|
Optional<Integer> |
getFadeOut()
Returns the current fade out effect time of the title.
|
Optional<Integer> |
getStay()
Returns the current stay effect time of the title.
|
Optional<Text> |
getSubtitle()
Returns the current subtitle of this builder.
|
Optional<Text> |
getTitle()
Returns the current title of this builder.
|
int |
hashCode() |
boolean |
isClear()
Returns whether this builder is currently configured to clear.
|
boolean |
isReset()
Returns whether this builder is currently configured to reset.
|
TitleBuilder |
reset()
Removes the currently displayed title from the player's screen and set
the configuration back to the default values.
|
TitleBuilder |
reset(boolean reset)
Sets whether the currently displayed title should be removed from the
player's screen and the configuration set back to the default values.
|
TitleBuilder |
stay(Integer stay)
Sets the duration in ticks how long the title should stay on the screen.
|
TitleBuilder |
subtitle(Text subtitle)
Sets the subtitle to send to the player.
|
TitleBuilder |
title(Text title)
Sets the title to send to the player.
|
String |
toString() |
public TitleBuilder()
TitleBuilder
.public TitleBuilder(Title title)
TitleBuilder
with the properties of the given
Title
as initial values.title
- The title to copy the values frompublic final Optional<Text> getTitle()
Optional.absent()
if noneTitle.getTitle()
public TitleBuilder title(@Nullable Text title)
title
- The text to use as the title, or null
to resetTitle.getTitle()
public final Optional<Text> getSubtitle()
Optional.absent()
if noneTitle.getSubtitle()
public TitleBuilder subtitle(@Nullable Text subtitle)
subtitle
- The text to use as the subtitle, or null
to resetTitle.getSubtitle()
public final Optional<Integer> getFadeIn()
Optional.absent()
if noneTitle.getFadeIn()
public TitleBuilder fadeIn(@Nullable Integer fadeIn)
stay(Integer)
.
The default value for Vanilla is 20 (1 second).
fadeIn
- The amount of ticks (1/20 second) for the fade in effect,
or null
to resetTitle.getFadeIn()
public final Optional<Integer> getStay()
Optional.absent()
if noneTitle.getStay()
public TitleBuilder stay(@Nullable Integer stay)
fadeOut(Integer)
.
The default value for Vanilla is 60 (3 seconds).
stay
- The amount of ticks (1/20 second) to stay, or null
to
resetTitle.getStay()
public final Optional<Integer> getFadeOut()
Optional.absent()
if noneTitle.getFadeOut()
public TitleBuilder fadeOut(@Nullable Integer fadeOut)
The default value for Vanilla is 20 (1 second).
fadeOut
- The amount of ticks (1/20 second) for the fade out effect,
or null
to resetTitle.getFadeOut()
public final boolean isClear()
true
if the title will clearTitle.isClear()
public TitleBuilder clear()
Title.isClear()
public TitleBuilder clear(boolean clear)
clear
- Whether this title should clearTitle.isClear()
public final boolean isReset()
true
if the title will resetTitle.isReset()
public TitleBuilder reset()
Title.isReset()
public TitleBuilder reset(boolean reset)
reset
- Whether this title should resetTitle.isReset()
public Title build()
Title
with the currently configured settings