Interface PacketGroupingAudience

All Superinterfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.audience.ForwardingAudience, net.kyori.adventure.pointer.Pointered
All Known Subinterfaces:
Scoreboard
All Known Implementing Classes:
BelowNameTag, Instance, InstanceContainer, SharedInstance, Sidebar, TabList, Team

public interface PacketGroupingAudience extends net.kyori.adventure.audience.ForwardingAudience
An audience implementation that sends grouped packets if possible.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudience

    net.kyori.adventure.audience.ForwardingAudience.Single
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull Iterable<? extends net.kyori.adventure.audience.Audience>
     
    default void
     
    @NotNull Collection<@NotNull Player>
    Gets an iterable of the players this audience contains.
    default void
    hideBossBar(@NotNull net.kyori.adventure.bossbar.BossBar bar)
     
    static @NotNull PacketGroupingAudience
    of(@NotNull Collection<Player> players)
    Creates a packet grouping audience that copies an iterable of players.
    default void
    playSound(@NotNull net.kyori.adventure.sound.Sound sound, double x, double y, double z)
     
    default void
    playSound(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull net.kyori.adventure.sound.Sound.Emitter emitter)
     
    default void
    playSound(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull Point point)
    Plays a Sound at a given point
    default void
     
    default void
    sendActionBar(@NotNull net.kyori.adventure.text.Component message)
     
    default void
    Broadcast a ServerPacket to all players of this audience
    default void
    sendMessage(@NotNull net.kyori.adventure.identity.Identity source, @NotNull net.kyori.adventure.text.Component message, @NotNull net.kyori.adventure.audience.MessageType type)
     
    default void
    sendPlayerListHeaderAndFooter(@NotNull net.kyori.adventure.text.Component header, @NotNull net.kyori.adventure.text.Component footer)
     
    default <T> void
    sendTitlePart(@NotNull net.kyori.adventure.title.TitlePart<T> part, T value)
     
    default void
    showBossBar(@NotNull net.kyori.adventure.bossbar.BossBar bar)
     
    default void
    stopSound(@NotNull net.kyori.adventure.sound.SoundStop stop)
     

    Methods inherited from interface net.kyori.adventure.audience.Audience

    deleteMessage, openBook, removeResourcePacks, removeResourcePacks, removeResourcePacks, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, showTitle, stopSound

    Methods inherited from interface net.kyori.adventure.audience.ForwardingAudience

    clearResourcePacks, deleteMessage, filterAudience, forEachAudience, openBook, playSound, pointers, removeResourcePacks, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendResourcePacks

    Methods inherited from interface net.kyori.adventure.pointer.Pointered

    get, getOrDefault, getOrDefaultFrom
  • Method Details

    • of

      @NotNull static @NotNull PacketGroupingAudience of(@NotNull @NotNull Collection<Player> players)
      Creates a packet grouping audience that copies an iterable of players. The underlying collection is not copied, so changes to the collection will be reflected in the audience.
      Parameters:
      players - the players
      Returns:
      the audience
    • getPlayers

      @NotNull @NotNull Collection<@NotNull Player> getPlayers()
      Gets an iterable of the players this audience contains.
      Returns:
      the connections
    • sendGroupedPacket

      default void sendGroupedPacket(@NotNull @NotNull ServerPacket packet)
      Broadcast a ServerPacket to all players of this audience
      Parameters:
      packet - the packet to broadcast
    • sendMessage

      default void sendMessage(@NotNull @NotNull net.kyori.adventure.identity.Identity source, @NotNull @NotNull net.kyori.adventure.text.Component message, @NotNull @NotNull net.kyori.adventure.audience.MessageType type)
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.Audience
      Specified by:
      sendMessage in interface net.kyori.adventure.audience.ForwardingAudience
    • sendActionBar

      default void sendActionBar(@NotNull @NotNull net.kyori.adventure.text.Component message)
      Specified by:
      sendActionBar in interface net.kyori.adventure.audience.Audience
      Specified by:
      sendActionBar in interface net.kyori.adventure.audience.ForwardingAudience
    • sendPlayerListHeaderAndFooter

      default void sendPlayerListHeaderAndFooter(@NotNull @NotNull net.kyori.adventure.text.Component header, @NotNull @NotNull net.kyori.adventure.text.Component footer)
      Specified by:
      sendPlayerListHeaderAndFooter in interface net.kyori.adventure.audience.Audience
      Specified by:
      sendPlayerListHeaderAndFooter in interface net.kyori.adventure.audience.ForwardingAudience
    • sendTitlePart

      default <T> void sendTitlePart(@NotNull @NotNull net.kyori.adventure.title.TitlePart<T> part, @NotNull T value)
      Specified by:
      sendTitlePart in interface net.kyori.adventure.audience.Audience
      Specified by:
      sendTitlePart in interface net.kyori.adventure.audience.ForwardingAudience
    • clearTitle

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

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

      default void showBossBar(@NotNull @NotNull net.kyori.adventure.bossbar.BossBar bar)
      Specified by:
      showBossBar in interface net.kyori.adventure.audience.Audience
      Specified by:
      showBossBar in interface net.kyori.adventure.audience.ForwardingAudience
    • hideBossBar

      default void hideBossBar(@NotNull @NotNull net.kyori.adventure.bossbar.BossBar bar)
      Specified by:
      hideBossBar in interface net.kyori.adventure.audience.Audience
      Specified by:
      hideBossBar in interface net.kyori.adventure.audience.ForwardingAudience
    • playSound

      default void playSound(@NotNull @NotNull net.kyori.adventure.sound.Sound sound, @NotNull @NotNull Point point)
      Plays a Sound at a given point
      Parameters:
      sound - The sound to play
      point - The point in this instance at which to play the sound
    • playSound

      default void playSound(@NotNull @NotNull net.kyori.adventure.sound.Sound sound, double x, double y, double z)
      Specified by:
      playSound in interface net.kyori.adventure.audience.Audience
      Specified by:
      playSound in interface net.kyori.adventure.audience.ForwardingAudience
    • playSound

      default void playSound(@NotNull @NotNull net.kyori.adventure.sound.Sound sound, @NotNull net.kyori.adventure.sound.Sound.Emitter emitter)
      Specified by:
      playSound in interface net.kyori.adventure.audience.Audience
      Specified by:
      playSound in interface net.kyori.adventure.audience.ForwardingAudience
    • stopSound

      default void stopSound(@NotNull @NotNull net.kyori.adventure.sound.SoundStop stop)
      Specified by:
      stopSound in interface net.kyori.adventure.audience.Audience
      Specified by:
      stopSound in interface net.kyori.adventure.audience.ForwardingAudience
    • audiences

      @NotNull default @NotNull Iterable<? extends net.kyori.adventure.audience.Audience> audiences()
      Specified by:
      audiences in interface net.kyori.adventure.audience.ForwardingAudience