Interface AudienceProvider<C>

Type Parameters:
C - Command sender type
All Superinterfaces:
Function<@NonNull C,​@NonNull net.kyori.adventure.audience.Audience>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AudienceProvider<C> extends Function<@NonNull C,​@NonNull net.kyori.adventure.audience.Audience>
Function that maps the command sender type to an adventure Audience
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull net.kyori.adventure.audience.Audience
    apply​(@NonNull C sender)
    Convert a command sender to an Audience
    static <C extends net.kyori.adventure.audience.Audience>
    AudienceProvider<C>
    Get an audience provider for sender types which are already an Audience.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • apply

      @NonNull net.kyori.adventure.audience.Audience apply(@NonNull C sender)
      Convert a command sender to an Audience
      Specified by:
      apply in interface Function<@NonNull C,​@NonNull net.kyori.adventure.audience.Audience>
      Parameters:
      sender - Command sender
      Returns:
      Mapped audience
    • nativeAudience

      static <C extends net.kyori.adventure.audience.Audience> AudienceProvider<C> nativeAudience()
      Get an audience provider for sender types which are already an Audience.
      Type Parameters:
      C - sender type
      Returns:
      native audience provider
      Since:
      1.5.0