Add configuration option for toggling "fly mode enabled" message on login

This commit is contained in:
vemacs 2016-01-18 19:21:29 -07:00
parent 3896bcbd64
commit b17f5d32c9
4 changed files with 12 additions and 1 deletions

View File

@ -276,7 +276,9 @@ public class EssentialsPlayerListener implements Listener {
if (LocationUtil.shouldFly(user.getLocation())) {
user.getBase().setAllowFlight(true);
user.getBase().setFlying(true);
user.getBase().sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
if (ess.getSettings().isSendFlyEnableOnJoin()) {
user.getBase().sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
}
}
}

View File

@ -235,4 +235,6 @@ public interface ISettings extends IConf {
long getLastMessageReplyRecipientTimeout();
boolean isMilkBucketEasterEggEnabled();
boolean isSendFlyEnableOnJoin();
}

View File

@ -1135,4 +1135,8 @@ public class Settings implements net.ess3.api.ISettings {
@Override public boolean isMilkBucketEasterEggEnabled() {
return config.getBoolean("milk-bucket-easter-egg", true);
}
@Override public boolean isSendFlyEnableOnJoin() {
return config.getBoolean("send-fly-enable-on-join", true);
}
}

View File

@ -463,6 +463,9 @@ last-message-reply-recipient: true
# Toggles whether or not right clicking mobs with a milk bucket turns them into a baby.
milk-bucket-easter-egg: true
# Toggles whether or not the fly status message should be sent to players on join
send-fly-enable-on-join: true
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #