Interface AdventureProvider<S>

Type Parameters:
S - the valueType of the source from which the Audience can be derived
All Known Implementing Classes:
CastingAdventure, EmptyAdventure

public interface AdventureProvider<S>
The AdventureProvider interface defines a mechanism for obtaining an Audience based on a given source or context. It is designed to facilitate communication or message broadcasting to a specific audience within the application, typically in a context like a game server or chat system where audiences are dynamically determined.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.kyori.adventure.audience.Audience
    Obtains an Audience for the specified source.
    default net.kyori.adventure.audience.Audience
    audience(studio.mevera.imperat.context.Source source)
    Obtains an Audience for a given Source instance.
    default void
    Performs any necessary cleanup or resource management.
    <SRC extends studio.mevera.imperat.context.Source>
    AdventureHelpComponent<SRC>
    createHelpComponent(net.kyori.adventure.text.Component component)
     
    default void
    send(S sender, net.kyori.adventure.text.ComponentLike component)
    Sends a message to the Audience derived from the specified source.
    default void
    send(studio.mevera.imperat.context.Source source, net.kyori.adventure.text.ComponentLike component)
    Sends a message to the Audience derived from the specified Source instance.
  • Method Details

    • audience

      net.kyori.adventure.audience.Audience audience(S s)
      Obtains an Audience for the specified source.
      Parameters:
      s - the source from which the Audience is derived
      Returns:
      the Audience corresponding to the given source
    • audience

      default net.kyori.adventure.audience.Audience audience(studio.mevera.imperat.context.Source source)
      Obtains an Audience for a given Source instance. This method delegates to audience(Object) by retrieving the origin from the provided Source.
      Parameters:
      source - the Source instance from which the Audience is derived
      Returns:
      the Audience corresponding to the origin of the provided Source
    • send

      default void send(S sender, net.kyori.adventure.text.ComponentLike component)
      Sends a message to the Audience derived from the specified source.
      Parameters:
      sender - the source from which the Audience is derived
      component - the message to be sent, represented by a ComponentLike instance
    • send

      default void send(studio.mevera.imperat.context.Source source, net.kyori.adventure.text.ComponentLike component)
      Sends a message to the Audience derived from the specified Source instance. This method delegates to send(Object, ComponentLike) by retrieving the origin from the provided Source.
      Parameters:
      source - the Source instance from which the Audience is derived
      component - the message to be sent, represented by a ComponentLike instance
    • close

      default void close()
      Performs any necessary cleanup or resource management. By default, this method does nothing, but it can be overridden to provide specific close operations.
    • createHelpComponent

      <SRC extends studio.mevera.imperat.context.Source> AdventureHelpComponent<SRC> createHelpComponent(net.kyori.adventure.text.Component component)