Need help by Permissions

LucGamesHD

Developer
Ich habe ein problem. The code does not want me to remove the old permission when I give the player a new one. :/

Sry for my english ://

Code:
 public static void initPerms(Player p, String group){
	  
		PlayerDatas.loadPlayerdatas();
		PermissionManager.loadPermissions();
	  
		List<String> Newperms = cfg.getStringList("groups." + PlayerDatas.getGroup(p) + ".permissions");
	  
		for(String permName : Newperms){
			System.out.println(permName);
			p.addAttachment(Main.getPlugin(), permName, false);
		}
	  
		addPlayerToGroup(p, group);
		PermissionManager.loadPermissions();
		PlayerDatas.loadPlayerdatas();
	  
		System.out.println("Gruppe: " + PlayerDatas.getGroup(p));
		List<String> Oldperms = cfg.getStringList("groups." + group + ".permissions");
	  
		for(String permName : Oldperms){
			p.addAttachment(Main.getPlugin(), permName, true);
		}
	  
	}
 
Top