I'm having trouble getting the Permission Class Variable from the String ex. Code (Text): String str = "minecraft.command.fill" PermissionAttachment attachment = player.addAttachment(plugin); attachment.setPermission(str, true); player.recalculatePermissions; Permission permission = str; //This is where I'm having trouble accomplishing my //task, a few will return !null but most will return null, even though the permission //sets just fine. permission.recalculatePermissibles(); Can this be done, am i going about it the wrong way? Thanks. Here is the method i am using. Spoiler @Param p is for debug only at this point @var permission.creativePlayerCommands() is a list of commands like "minecraft.command.fill" Code (Text): public void checkPermState(Player p) { p.sendMessage("Checking Perm State");//debug for(String str:permission.creativePlayerCommands()) { Permission permission = main.getServer().getPluginManager().getPermission(str); p.sendMessage("Permission = " + permission);//debug if(permission != null) { p.sendMessage("Recalculating Permissibles");//debug permission.recalculatePermissibles(); } } }
Bump Edit: nevermind, if I Instantiate the permission var properly everything works fine lol. for those that may find this in the future Code (Text): public void checkPermState() { for(String str:permission.creativePlayerCommands()) { Permission permission = new Permission(str); permission.recalculatePermissibles(); } }