Interface Audience

All Known Subinterfaces:
ForwardingAudience, PlayerAudience

public interface Audience
A universal interface for sending Mindustry content to receivers.
  • Method Details

    • of

      static Audience of(Audience... audiences)
      Creates an audience that forwards its content to the given audiences.
      Parameters:
      audiences - the audiences
      Returns:
      the forwarding audience
    • of

      static Audience of(Iterable<Audience> audiences)
      Creates an audience that forwards its content to the given audiences.
      Parameters:
      audiences - the audiences
      Returns:
      the forwarding audience
    • empty

      static Audience empty()
      Returns an empty audience that does nothing.
    • collectToAudience

      static Collector<Audience,?,Audience> collectToAudience()
      Returns a collector, combining a stream of audiences into a single forwarding audience.
    • sendMessage

      default void sendMessage(Component component)
      Sends a message to this audience.
      Parameters:
      component - the message
    • sendMessage

      default void sendMessage(Component component, Component unformatted, Audience sender)
      Sends a message to this audience.
      Parameters:
      component - the message
      unformatted - the unformatted message
      sender - the sender
    • sendWarning

      default void sendWarning(Component component)
      Sends a warning to this audience.
      Parameters:
      component - the warning
    • showHUDText

      default void showHUDText(Component component)
      Shows a HUD text to this audience.
      Parameters:
      component - the HUD text
    • hideHUDText

      default void hideHUDText()
      Hides the HUD text of this audience.
    • sendNotification

      default void sendNotification(Component component, char icon)
      Sends a notification to this audience.
      Parameters:
      component - the notification
      icon - the icon
    • sendAnnouncement

      default void sendAnnouncement(Component component)
      Sends an announcement to this audience.
      Parameters:
      component - the announcement
    • openURI

      default void openURI(URI uri)
      Sends an uri to open to this audience.
      Parameters:
      uri - the uri
    • showLabel

      default void showLabel(Component label, float x, float y, Duration duration)
      Shows a label to this audience.
      Parameters:
      label - the label
      x - the x position in world coordinates
      y - the y position in world coordinates
      duration - the duration
    • kick

      default void kick(Component reason, Duration duration)
      Kicks this audience from the server.
      Parameters:
      reason - the reason
      duration - the duration
    • getMetadata

      default KeyContainer getMetadata()
      Returns the metadata of this audience.
    • getAudiences

      default Iterable<Audience> getAudiences()
      Returns the audiences this audience forwards to.
    • toStream

      default Stream<Audience> toStream()
      Returns the audiences this audience forwards to as a stream.
    • getPermissions

      default PermissionContainer getPermissions()
      Returns the permissions of this audience.