Interface PacketGroupingAudience
- All Superinterfaces:
Audience
,ForwardingAudience
,Pointered
- All Known Subinterfaces:
Scoreboard
- All Known Implementing Classes:
BelowNameTag
,Instance
,InstanceContainer
,SharedInstance
,Sidebar
,TabList
,Team
An audience implementation that sends grouped packets if possible.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudience
ForwardingAudience.Single
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
@NotNull Collection
<@NotNull Player> Gets an iterable of the players this audience contains.default void
hideBossBar
(@NotNull BossBar bar) static @NotNull PacketGroupingAudience
of
(@NotNull Collection<Player> players) Creates a packet grouping audience that copies an iterable of players.default void
default void
playSound
(@NotNull Sound sound, @NotNull Sound.Emitter emitter) default void
Plays aSound
at a given pointdefault void
default void
sendActionBar
(@NotNull Component message) default void
sendGroupedPacket
(@NotNull ServerPacket packet) Broadcast a ServerPacket to all players of this audiencedefault void
sendMessage
(@NotNull Identity source, @NotNull Component message, @NotNull MessageType type) Deprecated.default void
sendNotification
(@NotNull Notification notification) Send aNotification
to the audience.default void
sendPlayerListHeaderAndFooter
(@NotNull Component header, @NotNull Component footer) default <T> void
sendTitlePart
(@NotNull TitlePart<T> part, T value) default void
showBossBar
(@NotNull BossBar bar) default void
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, removeResourcePacks, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendResourcePacks
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom
-
Method Details
-
of
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
Gets an iterable of the players this audience contains.- Returns:
- the connections
-
sendGroupedPacket
Broadcast a ServerPacket to all players of this audience- Parameters:
packet
- the packet to broadcast
-
sendMessage
@Deprecated default void sendMessage(@NotNull @NotNull Identity source, @NotNull @NotNull Component message, @NotNull @NotNull MessageType type) Deprecated.- Specified by:
sendMessage
in interfaceAudience
- Specified by:
sendMessage
in interfaceForwardingAudience
-
sendActionBar
- Specified by:
sendActionBar
in interfaceAudience
- Specified by:
sendActionBar
in interfaceForwardingAudience
-
sendTitlePart
- Specified by:
sendTitlePart
in interfaceAudience
- Specified by:
sendTitlePart
in interfaceForwardingAudience
-
clearTitle
default void clearTitle()- Specified by:
clearTitle
in interfaceAudience
- Specified by:
clearTitle
in interfaceForwardingAudience
-
resetTitle
default void resetTitle()- Specified by:
resetTitle
in interfaceAudience
- Specified by:
resetTitle
in interfaceForwardingAudience
-
showBossBar
- Specified by:
showBossBar
in interfaceAudience
- Specified by:
showBossBar
in interfaceForwardingAudience
-
hideBossBar
- Specified by:
hideBossBar
in interfaceAudience
- Specified by:
hideBossBar
in interfaceForwardingAudience
-
playSound
Plays aSound
at a given point- Parameters:
sound
- The sound to playpoint
- The point in this instance at which to play the sound
-
playSound
- Specified by:
playSound
in interfaceAudience
- Specified by:
playSound
in interfaceForwardingAudience
-
playSound
- Specified by:
playSound
in interfaceAudience
- Specified by:
playSound
in interfaceForwardingAudience
-
stopSound
- Specified by:
stopSound
in interfaceAudience
- Specified by:
stopSound
in interfaceForwardingAudience
-
sendNotification
Send aNotification
to the audience.- Parameters:
notification
- theNotification
to send
-
audiences
- Specified by:
audiences
in interfaceForwardingAudience
-