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 voidkick(ComponentLike reason, Duration duration) Kicks 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(ComponentLike component) Sends an announcement to this audience.default voidsendMessage(ComponentLike component) Sends a message to this audience.default voidsendMessage(ComponentLike component, ComponentLike unformatted, Audience sender) Sends a message to this audience.default voidsendNotification(ComponentLike component, char icon) Sends a notification to this audience.default voidsendWarning(ComponentLike component) Sends a warning to this audience.default voidshowHUDText(ComponentLike component) Shows a HUD text to this audience.default voidshowLabel(ComponentLike label, float x, float y, Duration duration) Shows 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.
-