From 6f4a5fee07874bcea4dbc1356619e908e050f70a Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sun, 2 Oct 2016 10:48:26 +0200 Subject: [PATCH] Add missing permission to plugin.yml, fix description --- docs/permission_nodes.md | 6 +++--- src/main/java/fr/xephi/authme/AntiBot.java | 7 +++---- .../java/fr/xephi/authme/permission/AdminPermission.java | 2 +- src/main/java/fr/xephi/authme/util/BukkitService.java | 1 - src/main/resources/plugin.yml | 3 +++ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/permission_nodes.md b/docs/permission_nodes.md index 9acaa7131..61f61c3e1 100644 --- a/docs/permission_nodes.md +++ b/docs/permission_nodes.md @@ -1,12 +1,12 @@ - + ## AuthMe Permission Nodes The following are the permission nodes that are currently supported by the latest dev builds. - **authme.admin.*** – Give access to all admin commands. - **authme.admin.accounts** – Administrator command to see all accounts associated with a user. -- **authme.admin.antibotmessages** – Administrator command to reload the plugin configuration. +- **authme.admin.antibotmessages** – Permission to see Antibot messages. - **authme.admin.changemail** – Administrator command to set or change the email address of a user. - **authme.admin.changepassword** – Administrator command to change the password of a user. - **authme.admin.converter** – Administrator command to convert old or other data to AuthMe data. @@ -47,4 +47,4 @@ The following are the permission nodes that are currently supported by the lates --- -This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sat Oct 01 23:34:27 CEST 2016 +This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sun Oct 02 10:47:16 CEST 2016 diff --git a/src/main/java/fr/xephi/authme/AntiBot.java b/src/main/java/fr/xephi/authme/AntiBot.java index cfbc1f9de..53ced436e 100644 --- a/src/main/java/fr/xephi/authme/AntiBot.java +++ b/src/main/java/fr/xephi/authme/AntiBot.java @@ -67,11 +67,10 @@ public class AntiBot { public void activateAntiBot() { antiBotStatus = AntiBotStatus.ACTIVE; - for(Player player : bukkitService.getOnlinePlayers()) { - if(!permissionsManager.hasPermission(player, AdminPermission.ANTIBOT_MESSAGES)) { - continue; + for (Player player : bukkitService.getOnlinePlayers()) { + if (permissionsManager.hasPermission(player, AdminPermission.ANTIBOT_MESSAGES)) { + messages.send(player, MessageKey.ANTIBOT_AUTO_ENABLED_MESSAGE); } - messages.send(player, MessageKey.ANTIBOT_AUTO_ENABLED_MESSAGE); } final int duration = settings.getProperty(ProtectionSettings.ANTIBOT_DURATION); diff --git a/src/main/java/fr/xephi/authme/permission/AdminPermission.java b/src/main/java/fr/xephi/authme/permission/AdminPermission.java index b34291282..ed5ab9f4c 100644 --- a/src/main/java/fr/xephi/authme/permission/AdminPermission.java +++ b/src/main/java/fr/xephi/authme/permission/AdminPermission.java @@ -101,7 +101,7 @@ public enum AdminPermission implements PermissionNode { RELOAD("authme.admin.reload", DefaultPermission.OP_ONLY), /** - * Administrator command to reload the plugin configuration. + * Permission to see Antibot messages. */ ANTIBOT_MESSAGES("authme.admin.antibotmessages", DefaultPermission.OP_ONLY), diff --git a/src/main/java/fr/xephi/authme/util/BukkitService.java b/src/main/java/fr/xephi/authme/util/BukkitService.java index 4931689ff..72bdacf7a 100644 --- a/src/main/java/fr/xephi/authme/util/BukkitService.java +++ b/src/main/java/fr/xephi/authme/util/BukkitService.java @@ -3,7 +3,6 @@ package fr.xephi.authme.util; import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.initialization.SettingsDependent; -import fr.xephi.authme.permission.PermissionNode; import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.properties.PluginSettings; import org.bukkit.BanEntry; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index f6af6d4c7..2b950e3a7 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -126,6 +126,9 @@ permissions: authme.admin.reload: description: Administrator command to reload the plugin configuration. default: op + authme.admin.antibotmessages: + description: Permission to see Antibot messages + default: op authme.player.*: description: Permission to use all player (non-admin) commands. children: