Class FacetAudience<V>

java.lang.Object
net.kyori.adventure.platform.facet.FacetAudience<V>
Type Parameters:
V - a viewer type
All Implemented Interfaces:
Closeable, AutoCloseable, Audience, Pointered

@Internal public class FacetAudience<V> extends Object implements Audience, Closeable
An Audience that is implemented by Facets.

This audience must support multiple viewers, although platforms do not use this feature yet.

This is not supported API. Subject to change at any time.

Since:
4.0.0
See Also:
  • Field Details

  • Constructor Details

    • FacetAudience

      public FacetAudience(@NotNull @NotNull FacetAudienceProvider provider, @NotNull @NotNull Collection<? extends V> viewers, @Nullable @Nullable Collection<? extends Facet.Chat> chat, @Nullable @Nullable Collection<? extends Facet.ActionBar> actionBar, @Nullable @Nullable Collection<? extends Facet.Title> title, @Nullable @Nullable Collection<? extends Facet.Sound> sound, @Nullable @Nullable Collection<? extends Facet.EntitySound> entitySound, @Nullable @Nullable Collection<? extends Facet.Book> book, @Nullable @Nullable Collection<? extends Facet.BossBar.Builder> bossBar, @Nullable @Nullable Collection<? extends Facet.TabList> tabList, @Nullable @Nullable Collection<? extends Facet.Pointers> pointerProviders)
      Create a new facet-based audience.
      Parameters:
      provider - for this audience
      viewers - the viewers receiving content sent to this audience
      chat - chat facet candidates
      actionBar - action bar facet candidates
      title - title facet candidates
      sound - sound facet candidates
      entitySound - entity sound facet candidates
      book - book facet candidates
      bossBar - boss bar facet candidates
      tabList - tab list facet candidates
      pointerProviders - facets that provide pointers to this audience
      Since:
      4.0.0
  • Method Details

    • addViewer

      public void addViewer(@NotNull V viewer)
      Add a member to this audience.
      Parameters:
      viewer - the viewer
      Since:
      4.0.0
    • removeViewer

      public void removeViewer(@NotNull V viewer)
      Remove a viewer from this audience.
      Parameters:
      viewer - the viewer to remove
      Since:
      4.0.0
    • refresh

      public void refresh()
      Refresh the audience.
      Since:
      4.0.0
    • sendMessage

      public void sendMessage(@NotNull @NotNull Identity source, @NotNull @NotNull Component original, @NotNull @NotNull MessageType type)
      Specified by:
      sendMessage in interface Audience
    • sendActionBar

      public void sendActionBar(@NotNull @NotNull Component original)
      Specified by:
      sendActionBar in interface Audience
    • playSound

      public void playSound(@NotNull Sound original)
      Specified by:
      playSound in interface Audience
    • playSound

      public void playSound(@NotNull @NotNull Sound sound, @NotNull Sound.Emitter emitter)
      Specified by:
      playSound in interface Audience
    • playSound

      public void playSound(@NotNull Sound original, double x, double y, double z)
      Specified by:
      playSound in interface Audience
    • stopSound

      public void stopSound(@NotNull @NotNull SoundStop original)
      Specified by:
      stopSound in interface Audience
    • openBook

      public void openBook(@NotNull Book original)
      Specified by:
      openBook in interface Audience
    • showTitle

      public void showTitle(@NotNull Title original)
      Specified by:
      showTitle in interface Audience
    • sendTitlePart

      public <T> void sendTitlePart(@NotNull @NotNull TitlePart<T> part, @NotNull T value)
      Specified by:
      sendTitlePart in interface Audience
    • clearTitle

      public void clearTitle()
      Specified by:
      clearTitle in interface Audience
    • resetTitle

      public void resetTitle()
      Specified by:
      resetTitle in interface Audience
    • showBossBar

      public void showBossBar(@NotNull @NotNull BossBar bar)
      Specified by:
      showBossBar in interface Audience
    • hideBossBar

      public void hideBossBar(@NotNull @NotNull BossBar bar)
      Specified by:
      hideBossBar in interface Audience
    • sendPlayerListHeader

      public void sendPlayerListHeader(@NotNull @NotNull Component header)
      Specified by:
      sendPlayerListHeader in interface Audience
    • sendPlayerListFooter

      public void sendPlayerListFooter(@NotNull @NotNull Component footer)
      Specified by:
      sendPlayerListFooter in interface Audience
    • sendPlayerListHeaderAndFooter

      public void sendPlayerListHeaderAndFooter(@NotNull @NotNull Component header, @NotNull @NotNull Component footer)
      Specified by:
      sendPlayerListHeaderAndFooter in interface Audience
    • pointers

      @NotNull public @NotNull Pointers pointers()
      Specified by:
      pointers in interface Pointered
    • contributePointers

      @OverrideOnly protected void contributePointers(Pointers.Builder builder)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable