use of de.dytanic.cloudnet.lib.player.permission.PermissionEntity in project CloudNet by Dytanic.
the class VaultPermissionImpl method playerAddGroup.
@Override
public boolean playerAddGroup(String s, String s1, String s2) {
OfflinePlayer offlinePlayer = getPlayer(s1);
PermissionEntity permissionEntity = offlinePlayer.getPermissionEntity();
GroupEntityData groupEntityData = CollectionWrapper.filter(permissionEntity.getGroups(), new Acceptable<GroupEntityData>() {
@Override
public boolean isAccepted(GroupEntityData groupEntityData) {
return groupEntityData.getGroup().equalsIgnoreCase(s2);
}
});
if (groupEntityData != null) {
permissionEntity.getGroups().remove(groupEntityData);
groupEntityData = new GroupEntityData(groupEntityData.getGroup(), 0);
} else {
groupEntityData = new GroupEntityData(groupEntityData.getGroup(), 0);
}
permissionEntity.getGroups().add(groupEntityData);
offlinePlayer.setPermissionEntity(permissionEntity);
updatePlayer(offlinePlayer);
return true;
}
use of de.dytanic.cloudnet.lib.player.permission.PermissionEntity in project CloudNet by Dytanic.
the class VaultPermissionImpl method groupHas.
@Override
public boolean groupHas(String s, String s1, String s2) {
OfflinePlayer offlinePlayer = getPlayer(s1);
PermissionEntity permissionEntity = offlinePlayer.getPermissionEntity();
return permissionEntity.isInGroup(s2);
}
use of de.dytanic.cloudnet.lib.player.permission.PermissionEntity in project CloudNet by Dytanic.
the class VaultPermissionImpl method playerInGroup.
@Override
public boolean playerInGroup(String s, String s1, String s2) {
OfflinePlayer offlinePlayer = getPlayer(s1);
PermissionEntity permissionEntity = offlinePlayer.getPermissionEntity();
return permissionEntity.isInGroup(s2);
}
Aggregations