Interface AudienceProvider<A>

Type Parameters:
A - the type that is provided

public interface AudienceProvider<A>
A generic provider of audiences or some subtype.
  • Method Summary

    Modifier and Type
    Method
    Description
    all()
    Gets all audience members.
    all(@NotNull Predicate<Audience> filter)
    Gets all audience members that match the given predicate.
    Gets the console as an audience.
    custom(@NotNull net.kyori.adventure.key.Key key)
    Gets all custom audience members stored using the given key.
    default A
    custom(@NotNull net.kyori.adventure.key.Keyed keyed)
    Gets all custom audience members stored using the given keyed object.
    default A
    custom(@NotNull net.kyori.adventure.key.Keyed keyed, Predicate<Audience> filter)
    Gets all custom audience members stored using the given keyed object that match the given predicate.
    custom(@NotNull net.kyori.adventure.key.Key key, Predicate<Audience> filter)
    Gets all custom audience members stored using the given key that match the given predicate.
    Gets all custom audience members.
    customs(@NotNull Predicate<Audience> filter)
    Gets all custom audience members matching the given predicate.
    Gets all audience members that are of type Player.
    players(@NotNull Predicate<Player> filter)
    Gets all audience members that are of type Player and match the predicate.
    Gets the audience registry used to register custom audiences.
    Gets the combination of players() and console().
  • Method Details

    • all

      @NotNull A all()
      Gets all audience members. This returns players() combined with customs() and console(). This can be a costly operation, so it is often preferable to use server() instead.
      Returns:
      all audience members
    • players

      @NotNull A players()
      Gets all audience members that are of type Player.
      Returns:
      all players
    • players

      @NotNull A players(@NotNull @NotNull Predicate<Player> filter)
      Gets all audience members that are of type Player and match the predicate.
      Parameters:
      filter - the predicate
      Returns:
      all players matching the predicate
    • console

      @NotNull A console()
      Gets the console as an audience.
      Returns:
      the console
    • server

      @NotNull A server()
      Gets the combination of players() and console().
      Returns:
      the audience of all players and the console
    • custom

      @NotNull default A custom(@NotNull @NotNull net.kyori.adventure.key.Keyed keyed)
      Gets all custom audience members stored using the given keyed object.
      Parameters:
      keyed - the keyed object
      Returns:
      all custom audience members stored using the key of the object
    • custom

      @NotNull A custom(@NotNull @NotNull net.kyori.adventure.key.Key key)
      Gets all custom audience members stored using the given key.
      Parameters:
      key - the key
      Returns:
      all custom audience members stored using the key
    • custom

      @NotNull default A custom(@NotNull @NotNull net.kyori.adventure.key.Keyed keyed, Predicate<Audience> filter)
      Gets all custom audience members stored using the given keyed object that match the given predicate.
      Parameters:
      keyed - the keyed object
      filter - the predicate
      Returns:
      all custom audience members stored using the key
    • custom

      @NotNull A custom(@NotNull @NotNull net.kyori.adventure.key.Key key, Predicate<Audience> filter)
      Gets all custom audience members stored using the given key that match the given predicate.
      Parameters:
      key - the key
      filter - the predicate
      Returns:
      all custom audience members stored using the key
    • customs

      @NotNull A customs()
      Gets all custom audience members.
      Returns:
      all custom audience members
    • customs

      @NotNull A customs(@NotNull @NotNull Predicate<Audience> filter)
      Gets all custom audience members matching the given predicate.
      Parameters:
      filter - the predicate
      Returns:
      all matching custom audience members
    • all

      @NotNull A all(@NotNull @NotNull Predicate<Audience> filter)
      Gets all audience members that match the given predicate.
      Parameters:
      filter - the predicate
      Returns:
      all matching audience members
    • registry

      @NotNull @NotNull AudienceRegistry registry()
      Gets the audience registry used to register custom audiences.
      Returns:
      the registry