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

@ -5,6 +5,7 @@ import com.earth2me.essentials.IUser;
import com.earth2me.essentials.User;
import net.ess3.api.events.PrivateMessagePreSendEvent;
import net.ess3.api.events.PrivateMessageSentEvent;
import org.bukkit.entity.Player;
import java.lang.ref.WeakReference;
@ -190,4 +191,9 @@ public class SimpleMessageRecipient implements IMessageRecipient {
public void setReplyRecipient(final IMessageRecipient replyRecipient) {
this.replyRecipient = new WeakReference<>(replyRecipient);
}
@Override
public boolean isHiddenFrom(Player player) {
return parent.isHiddenFrom(player);
}
}