Added confirmation message to mail sent

This commit is contained in:
2022-02-15 03:07:56 +01:00
parent fa79491088
commit 59781f486d
2 changed files with 7 additions and 0 deletions
@@ -17,6 +17,7 @@ import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ServerConnection;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
import net.kyori.adventure.text.minimessage.placeholder.Replacement;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import org.jetbrains.annotations.Nullable;
@@ -211,6 +212,10 @@ public class ChatHandler {
Map<String, Replacement<?>> placeholders = new HashMap<>();
placeholders.put("sender", Replacement.miniMessage(senderName));
optionalPlayer.ifPresent(player -> player.sendMessage(Utility.parseMiniMessage(Config.mailReceived, placeholders)));
commandSource.sendMessage(Utility.parseMiniMessage(Config.mailSent,
Placeholder.component("player_name", chatUser.getDisplayName()),
Placeholder.miniMessage("message", message)
));
}
public void readMail(CommandSource commandSource, String targetPlayer) {