Interface IMessageRecipient
- All Superinterfaces:
MailSender
- All Known Implementing Classes:
Console
,SimpleMessageRecipient
,User
Represents an interface for message recipients.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Represents a response for sending or receiving a message when usingsendMessage(IMessageRecipient, String)
oronReceiveMessage(IMessageRecipient, String)
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the display name of this recipient.getName()
Returns the name of this recipient.Returns theIMessageRecipient
this recipient should send replies to.boolean
isHiddenFrom
(Player player) boolean
Returns whether this recipient is reachable.onReceiveMessage
(IMessageRecipient sender, String message) This method is called when this recipient is receiving a message from anotherIMessageRecipient
.sendMessage
(IMessageRecipient recipient, String message) This method is called when thisIMessageRecipient
is sending a message to anotherIMessageRecipient
.void
sendMessage
(String message) Sends (prints) a message to this recipient.void
Sends a translated message to this recipient.void
setReplyRecipient
(IMessageRecipient recipient) Sets theIMessageRecipient
this recipient should send replies to.Translates a message.Methods inherited from interface net.essentialsx.api.v2.services.mail.MailSender
getUUID
-
Method Details
-
sendMessage
Sends (prints) a message to this recipient.- Parameters:
message
- message
-
sendTl
Sends a translated message to this recipient.- Parameters:
tlKey
- keyargs
- arguments
-
tlSender
Translates a message.- Parameters:
tlKey
- keyargs
- arguments- Returns:
- translated message
-
sendMessage
This method is called when thisIMessageRecipient
is sending a message to anotherIMessageRecipient
.The
IMessageRecipient.MessageResponse
that is returned is used to determine what exactly should happen in thesendMessage(IMessageRecipient, String)
implementation by thesender
.- Parameters:
recipient
- recipient to receive themessage
message
- message to send- Returns:
- the response of the message
-
onReceiveMessage
This method is called when this recipient is receiving a message from anotherIMessageRecipient
.The
IMessageRecipient.MessageResponse
that is returned is used to determine what exactly should happen in thesendMessage(IMessageRecipient, String)
implementation by thesender
.This method should only be called by
sendMessage(IMessageRecipient, String)
.- Parameters:
sender
- sender of themessage
message
- message being received- Returns:
- the response of the message
-
getName
String getName()Returns the name of this recipient. This name is typically used internally to identify this recipient.- Specified by:
getName
in interfaceMailSender
- Returns:
- name of this recipient
- See Also:
-
getDisplayName
String getDisplayName()Returns the display name of this recipient. This name is typically used when formatting messages.- Returns:
- display name of this recipient
-
isReachable
boolean isReachable()Returns whether this recipient is reachable. A case where the recipient is not reachable is if they are offline.- Returns:
- whether this recipient is reachable
-
getReplyRecipient
IMessageRecipient getReplyRecipient()Returns theIMessageRecipient
this recipient should send replies to.- Returns:
- message recipient
-
setReplyRecipient
Sets theIMessageRecipient
this recipient should send replies to.- Parameters:
recipient
- message recipient to set
-
isHiddenFrom
-