mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 18:55:11 +01:00
Updated authmePermissable methods in main class
This commit is contained in:
parent
eae6eb384f
commit
ffd36ba325
@ -566,15 +566,27 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
// Check if a player/command sender have a permission
|
// Check if a player/command sender have a permission
|
||||||
public boolean authmePermissible(Player player, String perm) {
|
public boolean authmePermissible(Player player, String perm) {
|
||||||
if (player.hasPermission(perm)) {
|
return getPermissionsManager().hasPermission(player, perm);
|
||||||
|
|
||||||
|
/*if (player.hasPermission(perm)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (permission != null) {
|
} else if (permission != null) {
|
||||||
return permission.playerHas(player, perm);
|
return permission.playerHas(player, perm);
|
||||||
}
|
}
|
||||||
return false;
|
return false;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean authmePermissible(CommandSender sender, String perm) {
|
public boolean authmePermissible(CommandSender sender, String perm) {
|
||||||
|
// Handle players with the permissions manager
|
||||||
|
if(sender instanceof Player) {
|
||||||
|
// Get the player instance
|
||||||
|
Player player = (Player) sender;
|
||||||
|
|
||||||
|
// Check whether the player has permission, return the result
|
||||||
|
return getPermissionsManager().hasPermission(player, perm);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Legacy system:
|
||||||
if (sender.hasPermission(perm)) {
|
if (sender.hasPermission(perm)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (permission != null) {
|
} else if (permission != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user