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(org.spongepowered.api.entity.living.player.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(org.spongepowered.api.entity.living.player.User player,
NucleusMailService.MailFilter... filters)
Gets mail for a specific player, optionally including a list of filters.
|
boolean |
removeMail(org.spongepowered.api.entity.living.player.User player,
MailMessage mailData)
Removes a specific mail for a specific player.
|
void |
sendMail(org.spongepowered.api.entity.living.player.User playerFrom,
org.spongepowered.api.entity.living.player.User playerTo,
String message)
Sends mail to a subject, addressed from another subject.
|
void |
sendMailFromConsole(org.spongepowered.api.entity.living.player.User playerTo,
String message)
Sends mail to a player, addressed from the console.
|
List<MailMessage> getMail(org.spongepowered.api.entity.living.player.User player, NucleusMailService.MailFilter... filters)
player - The User of the player to get the mail of.filters - The NucleusMailService.MailFiltersboolean removeMail(org.spongepowered.api.entity.living.player.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(org.spongepowered.api.entity.living.player.User playerFrom,
org.spongepowered.api.entity.living.player.User playerTo,
String message)
playerFrom - The User of the player to send the message from.playerTo - The User of the player to send the message to.message - The message.void sendMailFromConsole(org.spongepowered.api.entity.living.player.User playerTo,
String message)
playerTo - The User of the player to send the message to.message - The message.boolean clearUserMail(org.spongepowered.api.entity.living.player.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 UUIDs of the players.NucleusMailService.MailFilterdefault 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 UUIDs of the players.NucleusMailService.MailFilterdefault 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.MailFilterdefault 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.MailFilterdefault 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