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 interfaceFacet.ActionBar<V,M>A facet that sends action bars.static interfaceFacet.Book<V,M,B>A facet that opens a book.static interfaceFacet.BossBar<V>A facet that listens to boss bar changes.static interfaceFacet.BossBarEntity<V,P>A facet that listens to boss bar changes, using fake entities.static interfaceFacet.BossBarPacket<V>A facet that listens to boss bar changes, using packets.static interfaceFacet.Chat<V,M>A facet that sends chat messages.static interfaceFacet.ChatPacket<V,M>A facet that sends chat messages, using packets.static interfaceFacet.EntitySound<V,M>Create a sound that follows a certain entity.static interfaceFacet.FakeEntity<V,P>A facet for spawning client-side entities.static interfaceFacet.Message<V,M>A facet that converts components between formats.static interfaceFacet.Pointers<V>Methods for building pointers.static interfaceFacet.Position<V,P>A facet that requires a 3D vector.static interfaceFacet.Sound<V,P>A facet that plays and stops sounds.static interfaceFacet.TabList<V,M>Methods for working with the player tab list.static interfaceFacet.Title<V,M,C,T>A facet that shows, clears, and resets titles.static interfaceFacet.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 booleanisApplicable(V viewer)Gets whether this handler is applicable to a particular viewer.default booleanisSupported()Gets whether this handler is supported by the current runtime.static <V,F extends Facet<? extends V>>
@NotNull Collection<F>of(@NotNull Supplier<F>... suppliers)Creates a collection of supported facets.static <V,F extends Facet<V>>
Fof(@Nullable 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 Collection<F> of(@NotNull @NotNull 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 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
nullif 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
-
-