Add option to prevent replying from vanished players (#3703)

Closes #2066
This commit is contained in:
Josh Roy 2020-11-09 07:25:16 -05:00 committed by GitHub
parent 4d9a10147a
commit bb43e8f7b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 35 additions and 1 deletions

View file

@ -42,7 +42,8 @@ public class Commandr extends EssentialsCommand {
final IMessageRecipient target = messageSender.getReplyRecipient();
// Check to make sure the sender does have a quick-reply recipient
if (target == null) {
if (target == null || (!ess.getSettings().isReplyToVanished() && sender.isPlayer() && target.isHiddenFrom(sender.getPlayer()))) {
messageSender.setReplyRecipient(null);
throw new Exception(tl("foreverAlone"));
}
messageSender.sendMessage(target, message);