Package dev.unnm3d.redischat.mail
Class MailGUIManager
java.lang.Object
dev.unnm3d.redischat.mail.MailGUIManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
confirmSendMail
(org.bukkit.entity.Player sender, boolean confirm) Confirm the mail for the given player in the editor mode Send the mail to the recipientdeleteMail
(@NotNull Mail mail, @NotNull org.bukkit.entity.Player deleter) Delete mailgetPrivateMails
(@NotNull String playerName) Get all private mails of the given playergetPublicMails
(@NotNull String playerName) Get all public mails with the given player read statusvoid
openMailOptionsGui
(@NotNull org.bukkit.entity.Player player, @NotNull Mail mail) Open the mail options gui for the given playervoid
openPrivateMailGui
(org.bukkit.entity.Player player) Open the private mail gui for the given playervoid
openPublicMailGui
(org.bukkit.entity.Player player) Open the public mail gui for the given playervoid
previewMail
(org.bukkit.entity.Player sender) Preview the mail for the given player in the editor modeChange the read status of the mailSend mail to redisvoid
startEditorMode
(@NotNull org.bukkit.entity.Player sender, @NotNull String target, @NotNull String title, @NotNull String token) Start the editor mode for the given playervoid
stopEditorMode
(@NotNull org.bukkit.entity.Player sender, @NotNull String content) Stop the editor mode for the given player Fills the mail with the given content
-
Constructor Details
-
MailGUIManager
-
-
Method Details
-
startEditorMode
public void startEditorMode(@NotNull @NotNull org.bukkit.entity.Player sender, @NotNull @NotNull String target, @NotNull @NotNull String title, @NotNull @NotNull String token) Start the editor mode for the given player- Parameters:
sender
- The player to start the editor modetarget
- The recipient of the mailtitle
- The title of the mailtoken
- The token to open the web editor
-
stopEditorMode
public void stopEditorMode(@NotNull @NotNull org.bukkit.entity.Player sender, @NotNull @NotNull String content) Stop the editor mode for the given player Fills the mail with the given content- Parameters:
sender
- The player to stop the editor modecontent
- The content of the mail
-
previewMail
public void previewMail(org.bukkit.entity.Player sender) Preview the mail for the given player in the editor mode- Parameters:
sender
- The player to preview the mail
-
confirmSendMail
public void confirmSendMail(org.bukkit.entity.Player sender, boolean confirm) Confirm the mail for the given player in the editor mode Send the mail to the recipient- Parameters:
sender
- The player to confirm the mailconfirm
- If the mail should be sent
-
sendMail
Send mail to redis- Parameters:
mail
- Mail to send- Returns:
- CompletionStage
if mail was sent successfully
-
deleteMail
public CompletionStage<Boolean> deleteMail(@NotNull @NotNull Mail mail, @NotNull @NotNull org.bukkit.entity.Player deleter) Delete mail- Parameters:
mail
- Mail to deletedeleter
- The player who deletes the mail
-
readMail
public CompletionStage<Boolean> readMail(@NotNull @NotNull Mail mail, @NotNull @NotNull org.bukkit.entity.Player player, boolean read) Change the read status of the mail- Parameters:
mail
- Mail to change the read status- Returns:
- CompletionStage
if mail read status was set successfully
-
getPublicMails
Get all public mails with the given player read status- Parameters:
playerName
- The player name to get read statuses- Returns:
- CompletableFuture with all public mails
-
getPrivateMails
Get all private mails of the given player- Parameters:
playerName
- The player name to get private mails- Returns:
- CompletableFuture with all player private mails
-
openPublicMailGui
public void openPublicMailGui(org.bukkit.entity.Player player) Open the public mail gui for the given player- Parameters:
player
- The player to open the gui to
-
openPrivateMailGui
public void openPrivateMailGui(org.bukkit.entity.Player player) Open the private mail gui for the given player- Parameters:
player
- The player to open the gui to
-
openMailOptionsGui
public void openMailOptionsGui(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Mail mail) Open the mail options gui for the given player- Parameters:
player
- The player to open the gui tomail
- The mail to open the options to
-