Add world-time-permissions configurable variable (false by default) that justifies whether /time should check for per world permissions. This was recommended by Khobbits as newbies might get confused by this feature.

This commit is contained in:
Ali Moghnieh 2016-01-20 11:46:37 +00:00
parent d895d40fbf
commit c6d2746959
4 changed files with 14 additions and 1 deletions

View File

@ -237,4 +237,6 @@ public interface ISettings extends IConf {
boolean isMilkBucketEasterEggEnabled();
boolean isSendFlyEnableOnJoin();
boolean isWorldTimePermissions();
}

View File

@ -1139,4 +1139,9 @@ public class Settings implements net.ess3.api.ISettings {
@Override public boolean isSendFlyEnableOnJoin() {
return config.getBoolean("send-fly-enable-on-join", true);
}
@Override
public boolean isWorldTimePermissions() {
return config.getBoolean("world-time-permissions", false);
}
}

View File

@ -165,7 +165,8 @@ public class Commandtime extends EssentialsCommand {
}
private boolean canUpdateAll(User user) {
return user == null || user.isAuthorized("essentials.time.world.all");
return !ess.getSettings().isWorldTimePermissions() // First check if per world permissions are enabled, if not, return true.
|| user == null || user.isAuthorized("essentials.time.world.all");
}
private boolean canUpdateWorld(User user, World world) {

View File

@ -466,6 +466,11 @@ 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
# Set to true to enable per-world permissions for setting time for individual worlds with essentials commands.
# This applies to /time, /day, /eday, /night, /enight, /etime.
# Give someone permission to teleport to a world with essentials.time.world.<worldname>.
world-time-permissions: false
############################################################
# +------------------------------------------------------+ #
# | EssentialsHome | #