SHARE
TWEET

Untitled

a guest Jul 17th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package nl.ChimpGamer.BungeeTest.Hooks;
  2.  
  3. import com.github.cheesesoftware.PowerfulPermsAPI.Group;
  4. import com.github.cheesesoftware.PowerfulPermsAPI.PermissionManager;
  5. import com.github.cheesesoftware.PowerfulPermsAPI.PowerfulPermsPlugin;
  6. import net.md_5.bungee.BungeeCord;
  7.  
  8. import java.util.UUID;
  9.  
  10. public class PowerfulPermsHook {
  11.     private static PowerfulPermsPlugin powerfulPermsPlugin = (PowerfulPermsPlugin) BungeeCord.getInstance().getPluginManager().getPlugin("PowerfulPerms");
  12.  
  13.     public static PermissionManager getPermissionManager() {
  14.         return powerfulPermsPlugin.getPermissionManager();
  15.     }
  16.  
  17.     public static boolean isInGroup(UUID player, String group) {
  18.         for(Group group1 : getPermissionManager().getPermissionPlayer(player).getGroups()) {
  19.             if(group1.getName().contains(group)) {
  20.                 return true;
  21.             }
  22.         }
  23.         return false;
  24.     }
  25.  
  26.     public static boolean hasPermission(UUID player, String permission) {
  27.         return getPermissionManager().getPermissionPlayer(player).hasPermission(permission);
  28.     }
  29. }
RAW Paste Data
Top