add blocked message alert
This commit is contained in:
@ -4,6 +4,7 @@ import cc.fascinated.account.Account;
|
||||
import cc.fascinated.account.AccountManager;
|
||||
import cc.fascinated.config.Lang;
|
||||
import cc.fascinated.utils.Manager;
|
||||
import cc.fascinated.utils.MessageUtils;
|
||||
import cc.fascinated.utils.Style;
|
||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@ -38,6 +39,10 @@ public class ChatManager extends Manager {
|
||||
// Check if the message contains a domain and is not the server's domain.
|
||||
if (domainPattern.matcher(messageContent).find() && !messageContent.contains("aetheria.cc")) {
|
||||
blockedMessage = true;
|
||||
MessageUtils.messageOps(Lang.BLOCKED_MESSAGE_ALERT.getAsString()
|
||||
.replace("%player%", account.getName())
|
||||
.replace("%message%", messageContent)
|
||||
);
|
||||
}
|
||||
|
||||
// Block the message if it is the same as the last message sent.
|
||||
|
Reference in New Issue
Block a user