Class FacetAudience<V>

  • Type Parameters:
    V - a viewer type
    All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, net.kyori.adventure.audience.Audience

    public class FacetAudience<V>
    extends java.lang.Object
    implements net.kyori.adventure.audience.Audience, java.io.Closeable
    An Audience that is implemented by Facets.

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

    See Also:
    Facet
    • Constructor Summary

      Constructors 
      Constructor Description
      FacetAudience​(@NonNull java.util.Collection<? extends V> viewers, @Nullable java.util.Locale locale, @Nullable java.util.Collection<? extends Facet.Chat> chat, @Nullable java.util.Collection<? extends Facet.ActionBar> actionBar, @Nullable java.util.Collection<? extends Facet.Title> title, @Nullable java.util.Collection<? extends Facet.Sound> sound, @Nullable java.util.Collection<? extends Facet.Book> book, @Nullable java.util.Collection<? extends Facet.BossBar.Builder> bossBar)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addViewer​(@NonNull V viewer)  
      void changeLocale​(@NonNull java.util.Locale locale)
      Changes the locale.
      void clearTitle()  
      void close()  
      void hideBossBar​(@NonNull net.kyori.adventure.bossbar.BossBar bar)  
      void openBook​(@NonNull net.kyori.adventure.inventory.Book original)  
      void playSound​(@NonNull net.kyori.adventure.sound.Sound original)  
      void playSound​(@NonNull net.kyori.adventure.sound.Sound original, double x, double y, double z)  
      void removeViewer​(@NonNull V viewer)  
      void resetTitle()  
      void sendActionBar​(@NonNull net.kyori.adventure.text.Component original)  
      void sendMessage​(@NonNull net.kyori.adventure.text.Component original, @NonNull net.kyori.adventure.audience.MessageType type)  
      void showBossBar​(@NonNull net.kyori.adventure.bossbar.BossBar bar)  
      void showTitle​(@NonNull net.kyori.adventure.title.Title original)  
      void stopSound​(@NonNull net.kyori.adventure.sound.SoundStop original)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface net.kyori.adventure.audience.Audience

        openBook, sendActionBar, sendMessage, sendMessage, sendMessage
    • Constructor Detail

      • FacetAudience

        public FacetAudience​(@NonNull java.util.Collection<? extends V> viewers,
                             @Nullable java.util.Locale locale,
                             @Nullable java.util.Collection<? extends Facet.Chat> chat,
                             @Nullable java.util.Collection<? extends Facet.ActionBar> actionBar,
                             @Nullable java.util.Collection<? extends Facet.Title> title,
                             @Nullable java.util.Collection<? extends Facet.Sound> sound,
                             @Nullable java.util.Collection<? extends Facet.Book> book,
                             @Nullable java.util.Collection<? extends Facet.BossBar.Builder> bossBar)
    • Method Detail

      • addViewer

        public void addViewer​(@NonNull V viewer)
      • removeViewer

        public void removeViewer​(@NonNull V viewer)
      • changeLocale

        public void changeLocale​(@NonNull java.util.Locale locale)
        Changes the locale.
        Parameters:
        locale - a locale
      • sendMessage

        public void sendMessage​(@NonNull net.kyori.adventure.text.Component original,
                                @NonNull net.kyori.adventure.audience.MessageType type)
        Specified by:
        sendMessage in interface net.kyori.adventure.audience.Audience
      • sendActionBar

        public void sendActionBar​(@NonNull net.kyori.adventure.text.Component original)
        Specified by:
        sendActionBar in interface net.kyori.adventure.audience.Audience
      • playSound

        public void playSound​(@NonNull net.kyori.adventure.sound.Sound original)
        Specified by:
        playSound in interface net.kyori.adventure.audience.Audience
      • playSound

        public void playSound​(@NonNull net.kyori.adventure.sound.Sound original,
                              double x,
                              double y,
                              double z)
        Specified by:
        playSound in interface net.kyori.adventure.audience.Audience
      • stopSound

        public void stopSound​(@NonNull net.kyori.adventure.sound.SoundStop original)
        Specified by:
        stopSound in interface net.kyori.adventure.audience.Audience
      • openBook

        public void openBook​(@NonNull net.kyori.adventure.inventory.Book original)
        Specified by:
        openBook in interface net.kyori.adventure.audience.Audience
      • showTitle

        public void showTitle​(@NonNull net.kyori.adventure.title.Title original)
        Specified by:
        showTitle in interface net.kyori.adventure.audience.Audience
      • clearTitle

        public void clearTitle()
        Specified by:
        clearTitle in interface net.kyori.adventure.audience.Audience
      • resetTitle

        public void resetTitle()
        Specified by:
        resetTitle in interface net.kyori.adventure.audience.Audience
      • showBossBar

        public void showBossBar​(@NonNull net.kyori.adventure.bossbar.BossBar bar)
        Specified by:
        showBossBar in interface net.kyori.adventure.audience.Audience
      • hideBossBar

        public void hideBossBar​(@NonNull net.kyori.adventure.bossbar.BossBar bar)
        Specified by:
        hideBossBar in interface net.kyori.adventure.audience.Audience
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable