Interface Audience
- All Known Subinterfaces:
ForwardingAudience,PlayerAudience
public interface Audience
A universal interface for sending Mindustry content to receivers.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a collector, combining a stream of audiences into a single forwarding audience.static Audienceempty()Returns an empty audience that does nothing.Returns the audiences this audience forwards to.default KeyContainerReturns the metadata of this audience.default PermissionContainerReturns the permissions of this audience.default voidHides the HUD text of this audience.default voidKicks this audience from the server.static AudienceCreates an audience that forwards its content to the given audiences.static AudienceCreates an audience that forwards its content to the given audiences.default voidSends an uri to open to this audience.default voidsendAnnouncement(Component component) Sends an announcement to this audience.default voidsendMessage(Component component) Sends a message to this audience.default voidsendMessage(Component component, Component unformatted, Audience sender) Sends a message to this audience.default voidsendNotification(Component component, char icon) Sends a notification to this audience.default voidsendWarning(Component component) Sends a warning to this audience.default voidshowHUDText(Component component) Shows a HUD text to this audience.default voidShows a label to this audience.toStream()Returns the audiences this audience forwards to as a stream.
-
Method Details
-
of
Creates an audience that forwards its content to the given audiences.- Parameters:
audiences- the audiences- Returns:
- the forwarding audience
-
of
Creates an audience that forwards its content to the given audiences.- Parameters:
audiences- the audiences- Returns:
- the forwarding audience
-
empty
Returns an empty audience that does nothing. -
collectToAudience
Returns a collector, combining a stream of audiences into a single forwarding audience. -
sendMessage
Sends a message to this audience.- Parameters:
component- the message
-
sendMessage
Sends a message to this audience.- Parameters:
component- the messageunformatted- the unformatted messagesender- the sender
-
sendWarning
Sends a warning to this audience.- Parameters:
component- the warning
-
showHUDText
Shows a HUD text to this audience.- Parameters:
component- the HUD text
-
hideHUDText
default void hideHUDText()Hides the HUD text of this audience. -
sendNotification
Sends a notification to this audience.- Parameters:
component- the notificationicon- the icon
-
sendAnnouncement
Sends an announcement to this audience.- Parameters:
component- the announcement
-
openURI
Sends an uri to open to this audience.- Parameters:
uri- the uri
-
showLabel
Shows a label to this audience.- Parameters:
label- the labelx- the x position in world coordinatesy- the y position in world coordinatesduration- the duration
-
kick
Kicks this audience from the server.- Parameters:
reason- the reasonduration- the duration
-
getMetadata
Returns the metadata of this audience. -
getAudiences
Returns the audiences this audience forwards to. -
toStream
Returns the audiences this audience forwards to as a stream. -
getPermissions
Returns the permissions of this audience.
-