2016-03-30 15:42:36 +02:00
|
|
|
package com.gamingmesh.jobs.stuff;
|
|
|
|
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.permissions.Permission;
|
|
|
|
import org.bukkit.permissions.PermissionDefault;
|
|
|
|
|
|
|
|
public class Perm {
|
|
|
|
|
|
|
|
public static boolean hasPermission(CommandSender player, String permission) {
|
|
|
|
if (player instanceof Player)
|
|
|
|
return hasPermission((Player) player, permission);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean hasPermission(Player player, String permission) {
|
2016-06-09 17:35:24 +02:00
|
|
|
if (player == null)
|
|
|
|
return false;
|
2016-03-30 15:42:36 +02:00
|
|
|
Permission p = new Permission(permission, PermissionDefault.FALSE);
|
|
|
|
return player.hasPermission(p);
|
|
|
|
}
|
|
|
|
}
|