Interface Facet.Title<V,M,C,T>
-
- Type Parameters:
V
- a viewer typeM
- a message typeC
- a collection typeT
- a completed title type
- All Superinterfaces:
Facet<V>
,Facet.Message<V,M>
- All Known Subinterfaces:
Facet.TitlePacket<V,M,C,T>
public static interface Facet.Title<V,M,C,T> extends Facet.Message<V,M>
A facet that shows, clears, and resets titles.- Since:
- 4.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.kyori.adventure.platform.facet.Facet
Facet.ActionBar<V,M>, Facet.Book<V,M,B>, Facet.BossBar<V>, Facet.BossBarEntity<V,P>, Facet.BossBarPacket<V>, Facet.Chat<V,M>, Facet.ChatPacket<V,M>, Facet.EntitySound<V,M>, Facet.FakeEntity<V,P>, Facet.Message<V,M>, Facet.Pointers<V>, Facet.Position<V,P>, Facet.Sound<V,P>, Facet.TabList<V,M>, Facet.Title<V,M,C,T>, Facet.TitlePacket<V,M,C,T>
-
-
Field Summary
Fields Modifier and Type Field Description static long
MAX_SECONDS
static int
PROTOCOL_ACTION_BAR
-
Fields inherited from interface net.kyori.adventure.platform.facet.Facet.Message
PROTOCOL_HEX_COLOR, PROTOCOL_JSON
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
clearTitle(V viewer)
Clears a title.T
completeTitle(C coll)
Complete a title.void
contributeSubtitle(C coll, M subtitle)
Contribute a subtitle part to the title builder.void
contributeTimes(C coll, int inTicks, int stayTicks, int outTicks)
Contribute a times part to the title builder.void
contributeTitle(C coll, M title)
Contribute a title part to the title builder.C
createTitleCollection()
Creates a collection that will receive title parts.void
resetTitle(V viewer)
Resets a title.void
showTitle(V viewer, T title)
Shows a title.default int
toTicks(@Nullable java.time.Duration duration)
Gets the ticks for a duration.-
Methods inherited from interface net.kyori.adventure.platform.facet.Facet
isApplicable, isSupported
-
Methods inherited from interface net.kyori.adventure.platform.facet.Facet.Message
createMessage
-
-
-
-
Field Detail
-
PROTOCOL_ACTION_BAR
static final int PROTOCOL_ACTION_BAR
- See Also:
- Constant Field Values
-
MAX_SECONDS
static final long MAX_SECONDS
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTitleCollection
@NotNull C createTitleCollection()
Creates a collection that will receive title parts.- Returns:
- the collection
- Since:
- 4.0.0
-
contributeTitle
void contributeTitle(@NotNull C coll, @NotNull M title)
Contribute a title part to the title builder.This will only be called if a title is present
- Parameters:
coll
- collectiontitle
- title text- Since:
- 4.0.0
-
contributeSubtitle
void contributeSubtitle(@NotNull C coll, @NotNull M subtitle)
Contribute a subtitle part to the title builder.This will only be called if a subtitle is present
- Parameters:
coll
- collectionsubtitle
- subtitle text- Since:
- 4.0.0
-
contributeTimes
void contributeTimes(@NotNull C coll, int inTicks, int stayTicks, int outTicks)
Contribute a times part to the title builder.This will only be called if times are present
- Parameters:
coll
- collectioninTicks
- number of fade in ticksstayTicks
- number of stay ticksoutTicks
- number of fade out ticks- Since:
- 4.0.0
-
completeTitle
@Nullable T completeTitle(@NotNull C coll)
Complete a title.- Parameters:
coll
- The in-progress collection of parts- Returns:
- a title or
null
- Since:
- 4.0.0
-
showTitle
void showTitle(@NotNull V viewer, @NotNull T title)
Shows a title.- Parameters:
viewer
- a viewertitle
- a title- Since:
- 4.0.0
-
clearTitle
void clearTitle(@NotNull V viewer)
Clears a title.- Parameters:
viewer
- a viewer- Since:
- 4.0.0
-
resetTitle
void resetTitle(@NotNull V viewer)
Resets a title.- Parameters:
viewer
- a viewer- Since:
- 4.0.0
-
toTicks
default int toTicks(@Nullable @Nullable java.time.Duration duration)
Gets the ticks for a duration.- Parameters:
duration
- a duration- Returns:
- the ticks
- Since:
- 4.0.0
-
-