Prevent sending mail to ignored players.
Added a check to block users from sending mail to players who have ignored them. A message is displayed to inform the sender, ensuring clearer communication and respecting player preferences.
This commit is contained in:
parent
5212954946
commit
cb0bda8d5b
|
|
@ -205,6 +205,10 @@ public class ChatHandler {
|
|||
}
|
||||
Mail mail = new Mail(targetUUID, uuid, message);
|
||||
ChatUser chatUser = ChatUserManager.getChatUser(targetUUID);
|
||||
if (chatUser.getIgnoredPlayers().contains(uuid)) {
|
||||
commandSource.sendMessage(Utility.parseMiniMessage("<red>You cannot mail this player</red>"));
|
||||
return;
|
||||
}
|
||||
chatUser.addMail(mail);
|
||||
// TODO load from config
|
||||
String finalSenderName = senderName;
|
||||
|
|
@ -319,4 +323,4 @@ public class ChatHandler {
|
|||
return component;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user