mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-06 21:18:03 +02:00
Minor optimization when checking bukkit permissions.
This commit is contained in:
parent
a8da3eebd7
commit
d2d8d191da
@ -146,4 +146,5 @@ v 1.9:
|
||||
- Removed BukkitPermsOverride as this is now the default with bukkit handling child nodes.
|
||||
- Prevent adding inheritances and info nodes to globalgroups. These are permissions collections, not player groups.
|
||||
- Prevent promoting players to, and demoting to GlobalGroups.
|
||||
- Make 'manload' reload the config correctly.
|
||||
- Make 'manload' reload the config correctly.
|
||||
- Minor optimization when checking bukkit permissions.
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user