Package com.earth2me.essentials
Class Console
java.lang.Object
com.earth2me.essentials.Console
- All Implemented Interfaces:
IMessageRecipient
,MailSender
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.earth2me.essentials.messaging.IMessageRecipient
IMessageRecipient.MessageResponse
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic CommandSender
getCommandSender
(Server server) Deprecated.Returns the display name of this recipient.static Console
getName()
Returns the name of this recipient.Returns theIMessageRecipient
this recipient should send replies to.getUUID()
Gets theUUID
of thisMailSender
or null if this sender doesn't have a UUID.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.
-
Field Details
-
NAME
- See Also:
-
DISPLAY_NAME
-
-
Method Details
-
getInstance
-
getCommandSender
Deprecated.- Throws:
Exception
-
getCommandSender
-
getName
Description copied from interface:IMessageRecipient
Returns the name of this recipient. This name is typically used internally to identify this recipient.- Specified by:
getName
in interfaceIMessageRecipient
- Specified by:
getName
in interfaceMailSender
- Returns:
- name of this recipient
- See Also:
-
getUUID
Description copied from interface:MailSender
Gets theUUID
of thisMailSender
or null if this sender doesn't have a UUID.- Specified by:
getUUID
in interfaceMailSender
- Returns:
- The sender's
UUID
or null if N/A.
-
getDisplayName
Description copied from interface:IMessageRecipient
Returns the display name of this recipient. This name is typically used when formatting messages.- Specified by:
getDisplayName
in interfaceIMessageRecipient
- Returns:
- display name of this recipient
-
sendMessage
Description copied from interface:IMessageRecipient
Sends (prints) a message to this recipient.- Specified by:
sendMessage
in interfaceIMessageRecipient
- Parameters:
message
- message
-
sendTl
Description copied from interface:IMessageRecipient
Sends a translated message to this recipient.- Specified by:
sendTl
in interfaceIMessageRecipient
- Parameters:
tlKey
- keyargs
- arguments
-
tlSender
Description copied from interface:IMessageRecipient
Translates a message.- Specified by:
tlSender
in interfaceIMessageRecipient
- Parameters:
tlKey
- keyargs
- arguments- Returns:
- translated message
-
isReachable
public boolean isReachable()Description copied from interface:IMessageRecipient
Returns whether this recipient is reachable. A case where the recipient is not reachable is if they are offline.- Specified by:
isReachable
in interfaceIMessageRecipient
- Returns:
- whether this recipient is reachable
-
sendMessage
Description copied from interface:IMessageRecipient
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 theIMessageRecipient.sendMessage(IMessageRecipient, String)
implementation by thesender
.- Specified by:
sendMessage
in interfaceIMessageRecipient
- Parameters:
recipient
- recipient to receive themessage
message
- message to send- Returns:
- the response of the message
-
onReceiveMessage
Description copied from interface:IMessageRecipient
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 theIMessageRecipient.sendMessage(IMessageRecipient, String)
implementation by thesender
.This method should only be called by
IMessageRecipient.sendMessage(IMessageRecipient, String)
.- Specified by:
onReceiveMessage
in interfaceIMessageRecipient
- Parameters:
sender
- sender of themessage
message
- message being received- Returns:
- the response of the message
-
getReplyRecipient
Description copied from interface:IMessageRecipient
Returns theIMessageRecipient
this recipient should send replies to.- Specified by:
getReplyRecipient
in interfaceIMessageRecipient
- Returns:
- message recipient
-
setReplyRecipient
Description copied from interface:IMessageRecipient
Sets theIMessageRecipient
this recipient should send replies to.- Specified by:
setReplyRecipient
in interfaceIMessageRecipient
- Parameters:
recipient
- message recipient to set
-
isHiddenFrom
- Specified by:
isHiddenFrom
in interfaceIMessageRecipient
-
getCommandSender()