diff options
author | ElgarL <ElgarL@palmergames.com> | 2012-03-03 13:00:17 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2012-03-03 13:00:17 +0000 |
commit | d2d8d191dad6af966ee1bda365d72098a52b587b (patch) | |
tree | 9f4b58e2e3218a98622604bef7d445b3ed0bd553 /EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions | |
parent | a8da3eebd72eaf74303502a251a2daa8a371de92 (diff) | |
download | Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar.gz Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar.lz Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.tar.xz Essentials-d2d8d191dad6af966ee1bda365d72098a52b587b.zip |
Minor optimization when checking bukkit permissions.
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java index bd2829f38..b9315e849 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/permissions/AnjoPermissionsHandler.java @@ -17,9 +17,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder; import org.anjocaido.groupmanager.data.User; import org.anjocaido.groupmanager.utils.PermissionCheckResult; import org.anjocaido.groupmanager.utils.PermissionCheckResult.Type; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import org.bukkit.permissions.Permission; /** * Everything here maintains the model created by Nijikokun @@ -767,9 +765,9 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface { // Check Bukkit perms to support plugins which add perms via code // (Heroes). final Player player = user.getBukkitPlayer(); - final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission); - if (player != null && bukkitPerm != null) { - result.resultType = player.hasPermission(bukkitPerm) ? PermissionCheckResult.Type.FOUND : PermissionCheckResult.Type.NEGATION; + //final Permission bukkitPerm = Bukkit.getPluginManager().getPermission(targetPermission); + if (player != null && player.hasPermission(targetPermission)) { + result.resultType = PermissionCheckResult.Type.FOUND; result.owner = user; return result; } |