From d2d8d191dad6af966ee1bda365d72098a52b587b Mon Sep 17 00:00:00 2001 From: ElgarL Date: Sat, 3 Mar 2012 13:00:17 +0000 Subject: Minor optimization when checking bukkit permissions. --- .../groupmanager/permissions/AnjoPermissionsHandler.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'EssentialsGroupManager/src/org/anjocaido') 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; } -- cgit v1.2.3