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
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull FacetAudienceProvider<V,FacetAudience<V>> -
Constructor Summary
ConstructorsConstructorDescriptionFacetAudience(@NotNull FacetAudienceProvider provider, @NotNull Collection<? extends V> viewers, @Nullable Collection<? extends Facet.Chat> chat, @Nullable Collection<? extends Facet.ActionBar> actionBar, @Nullable Collection<? extends Facet.Title> title, @Nullable Collection<? extends Facet.Sound> sound, @Nullable Collection<? extends Facet.EntitySound> entitySound, @Nullable Collection<? extends Facet.Book> book, @Nullable Collection<? extends Facet.BossBar.Builder> bossBar, @Nullable Collection<? extends Facet.TabList> tabList, @Nullable Collection<? extends Facet.Pointers> pointerProviders) Create a new facet-based audience. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a member to this audience.voidvoidclose()protected voidcontributePointers(Pointers.Builder builder) voidhideBossBar(@NotNull BossBar bar) voidvoidvoidvoidplaySound(@NotNull Sound sound, @NotNull Sound.Emitter emitter) @NotNull Pointerspointers()voidrefresh()Refresh the audience.voidremoveViewer(V viewer) Remove a viewer from this audience.voidvoidsendActionBar(@NotNull Component original) voidsendMessage(@NotNull Identity source, @NotNull Component original, @NotNull MessageType type) voidsendPlayerListFooter(@NotNull Component footer) voidsendPlayerListHeader(@NotNull Component header) voidsendPlayerListHeaderAndFooter(@NotNull Component header, @NotNull Component footer) <T> voidsendTitlePart(@NotNull TitlePart<T> part, T value) voidshowBossBar(@NotNull BossBar bar) voidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.kyori.adventure.audience.Audience
filterAudience, forEachAudience, openBook, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, stopSoundMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom
-
Field Details
-
provider
-
-
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 audienceviewers- the viewers receiving content sent to this audiencechat- chat facet candidatesactionBar- action bar facet candidatestitle- title facet candidatessound- sound facet candidatesentitySound- entity sound facet candidatesbook- book facet candidatesbossBar- boss bar facet candidatestabList- tab list facet candidatespointerProviders- facets that provide pointers to this audience- Since:
- 4.0.0
-
-
Method Details
-
addViewer
Add a member to this audience.- Parameters:
viewer- the viewer- Since:
- 4.0.0
-
removeViewer
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:
sendMessagein interfaceAudience
-
sendActionBar
- Specified by:
sendActionBarin interfaceAudience
-
playSound
-
playSound
-
playSound
-
stopSound
-
openBook
-
showTitle
-
sendTitlePart
- Specified by:
sendTitlePartin interfaceAudience
-
clearTitle
public void clearTitle()- Specified by:
clearTitlein interfaceAudience
-
resetTitle
public void resetTitle()- Specified by:
resetTitlein interfaceAudience
-
showBossBar
- Specified by:
showBossBarin interfaceAudience
-
hideBossBar
- Specified by:
hideBossBarin interfaceAudience
-
sendPlayerListHeader
- Specified by:
sendPlayerListHeaderin interfaceAudience
-
pointers
-
contributePointers
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-