public interface NucleusMailService
Modifier and Type | Interface and Description |
---|---|
static interface |
NucleusMailService.MailFilter
This
NucleusMailService.MailFilter is simply to prevent compiler warnings with varargs, and is functionally the same as a
Predicate |
Modifier and Type | Method and Description |
---|---|
boolean |
clearUserMail(User player)
Clears the player's mail.
|
default NucleusMailService.MailFilter |
createDateFilter(Instant after,
Instant before)
Create a filter that restricts the mail to a certain time period.
|
default NucleusMailService.MailFilter |
createMessageFilter(boolean caseSensitive,
Collection<String> message)
Create a filter that restricts the messages returned to the provided substring.
|
default NucleusMailService.MailFilter |
createMessageFilter(boolean caseSensitive,
String... message)
Create a filter that restricts the messages returned to the provided substring.
|
default NucleusMailService.MailFilter |
createSenderFilter(boolean includeConsole,
Collection<UUID> player)
Create a filter that restricts the mail to the senders provided.
|
default NucleusMailService.MailFilter |
createSenderFilter(boolean includeConsole,
UUID... player)
Create a filter that restricts the mail to the senders provided.
|
List<MailMessage> |
getMail(User player,
NucleusMailService.MailFilter... filters)
Gets mail for a specific player, optionally including a list of filters.
|
boolean |
removeMail(User player,
MailMessage mailData)
Removes a specific mail for a specific player.
|
void |
sendMail(User playerFrom,
User playerTo,
String message)
Sends mail to a subject, addressed from another subject.
|
void |
sendMailFromConsole(User playerTo,
String message)
Sends mail to a player, addressed from the console.
|
List<MailMessage> getMail(User player, NucleusMailService.MailFilter... filters)
player
- The User
of the player to get the mail of.filters
- The NucleusMailService.MailFilter
sboolean removeMail(User player, MailMessage mailData)
player
- The User
to remove the mail from.mailData
- The MailMessage
to remove from the player.true
if the mail was removed, false
if the player didn't have the mail.void sendMail(User playerFrom, User playerTo, String message)
void sendMailFromConsole(User playerTo, String message)
playerTo
- The User
of the player to send the message to.message
- The message.boolean clearUserMail(User player)
player
- The UUID
of the player.default NucleusMailService.MailFilter createSenderFilter(boolean includeConsole, UUID... player)
Multiple player filters can be provided - this will return messages authored by all specified players.
includeConsole
- If true
, include the console/plugins in any returned mail.player
- The UUID
s of the players.NucleusMailService.MailFilter
default NucleusMailService.MailFilter createSenderFilter(boolean includeConsole, Collection<UUID> player)
Multiple player filters can be provided - this will return messages authored by all specified players.
includeConsole
- If true
, include the console/plugins in any returned mail.player
- The UUID
s of the players.NucleusMailService.MailFilter
default NucleusMailService.MailFilter createDateFilter(@Nullable Instant after, @Nullable Instant before)
Only one of these filters can be used at a time.
after
- The Instant
which indicates the earliest date to return.before
- The Instant
which indicates the latest date to return.NucleusMailService.MailFilter
default NucleusMailService.MailFilter createMessageFilter(boolean caseSensitive, String... message)
If multiple strings are set, all need to match.
caseSensitive
- Whether this filter is case sensitive.message
- The message.NucleusMailService.MailFilter
default NucleusMailService.MailFilter createMessageFilter(boolean caseSensitive, Collection<String> message)
If multiple strings are set, all need to match.
caseSensitive
- Whether this filter is case sensitive.message
- The message.NucleusMailService.MailFilter