Add option to not send no new mail message on join.

This commit is contained in:
drtshock 2015-04-16 09:25:29 -05:00
parent f8160c6318
commit f5b40dba34
4 changed files with 14 additions and 1 deletions

View File

@ -254,7 +254,9 @@ public class EssentialsPlayerListener implements Listener {
if (!ess.getSettings().isCommandDisabled("mail") && user.isAuthorized("essentials.mail")) {
final List<String> mail = user.getMails();
if (mail.isEmpty()) {
user.sendMessage(tl("noNewMail"));
if(ess.getSettings().isNotifyNoNewMail()) {
user.sendMessage(tl("noNewMail")); // Only notify if they want us to.
}
} else {
user.sendMessage(tl("youHaveNewMail", mail.size()));
}

View File

@ -215,4 +215,6 @@ public interface ISettings extends IConf {
boolean isCustomQuitMessage();
String getCustomQuitMessage();
boolean isNotifyNoNewMail();
}

View File

@ -1056,6 +1056,11 @@ public class Settings implements net.ess3.api.ISettings {
return isCustomQuitMessage;
}
@Override
public boolean isNotifyNoNewMail() {
return config.getBoolean("notify-no-new-mail", true);
}
// #easteregg
@Override
public int getMaxUserCacheCount() {

View File

@ -86,6 +86,10 @@ spawnmob-limit: 10
# Shall we notify users when using /lightning?
warn-on-smite: true
# Essentials Mail Notification
# Should we notify players if they have no new mail?
notify-no-new-mail: true
# The motd and rules are now configured in the files motd.txt and rules.txt.
# When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take priority.