Interface Facet<V>
-
- Type Parameters:
V
- a viewer type
- All Known Subinterfaces:
Facet.ActionBar<V,M>
,Facet.Book<V,M,B>
,Facet.BossBar.Builder<V,B>
,Facet.BossBarEntity<V,P>
,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>
,FacetComponentFlattener.Translator<V>
- All Known Implementing Classes:
FacetBase
@Internal public interface Facet<V>
A unit of functionality for a viewer.This is not supported API. Subject to change at any time.
- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Facet.ActionBar<V,M>
A facet that sends action bars.static interface
Facet.Book<V,M,B>
A facet that opens a book.static interface
Facet.BossBar<V>
A facet that listens to boss bar changes.static interface
Facet.BossBarEntity<V,P>
A facet that listens to boss bar changes, using fake entities.static interface
Facet.BossBarPacket<V>
A facet that listens to boss bar changes, using packets.static interface
Facet.Chat<V,M>
A facet that sends chat messages.static interface
Facet.ChatPacket<V,M>
A facet that sends chat messages, using packets.static interface
Facet.EntitySound<V,M>
Create a sound that follows a certain entity.static interface
Facet.FakeEntity<V,P>
A facet for spawning client-side entities.static interface
Facet.Message<V,M>
A facet that converts components between formats.static interface
Facet.Pointers<V>
Methods for building pointers.static interface
Facet.Position<V,P>
A facet that requires a 3D vector.static interface
Facet.Sound<V,P>
A facet that plays and stops sounds.static interface
Facet.TabList<V,M>
Methods for working with the player tab list.static interface
Facet.Title<V,M,C,T>
A facet that shows, clears, and resets titles.static interface
Facet.TitlePacket<V,M,C,T>
A facet that sends titles, using packets.
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
isApplicable(V viewer)
Gets whether this handler is applicable to a particular viewer.default boolean
isSupported()
Gets whether this handler is supported by the current runtime.static <V,F extends Facet<? extends V>>
@NotNull java.util.Collection<F>of(@NotNull java.util.function.Supplier<F>... suppliers)
Creates a collection of supported facets.static <V,F extends Facet<V>>
Fof(@Nullable java.util.Collection<F> facets, V viewer)
Gets the first applicable facet for a viewer.
-
-
-
Method Detail
-
of
@SafeVarargs @NotNull static <V,F extends Facet<? extends V>> @NotNull java.util.Collection<F> of(@NotNull @NotNull java.util.function.Supplier<F>... suppliers)
Creates a collection of supported facets.- Type Parameters:
V
- a viewer typeF
- a facet type- Parameters:
suppliers
- an array of facet suppliers- Returns:
- a collection of facets
- Since:
- 4.0.0
-
of
@Nullable static <V,F extends Facet<V>> F of(@Nullable @Nullable java.util.Collection<F> facets, @Nullable V viewer)
Gets the first applicable facet for a viewer.- Type Parameters:
V
- a viewer typeF
- a facet type- Parameters:
facets
- a collection of supported facetsviewer
- a viewer- Returns:
- a facet or
null
if none are applicable - Since:
- 4.0.0
-
isSupported
default boolean isSupported()
Gets whether this handler is supported by the current runtime.If not, this can be discarded since it will fail for all viewers.
- Returns:
- if this handler is supported
- Since:
- 4.0.0
-
isApplicable
default boolean isApplicable(@NotNull V viewer)
Gets whether this handler is applicable to a particular viewer.This should only be invoked if
isSupported()
istrue
.- Parameters:
viewer
- a viewer- Returns:
- if this handler is applicable to a viewer
- Since:
- 4.0.0
-
-