Error in API
Closed this issue ยท 1 comments
User user = ....;
LuckPermsRank mainGroup = ranks.get(0);
user.setPrimaryGroup("hola");
What is FAIL detect :|
Class API/User
@Override
public DataMutateResult setPrimaryGroup(@Nonnull String group) {
Objects.requireNonNull(group, "group");
if (getPrimaryGroup().equalsIgnoreCase(group)) {
return DataMutateResult.ALREADY_HAS;
}
if (!this.handle.hasPermission(NodeFactory.buildGroupNode(group.toLowerCase()).build()).asBoolean()) {
return DataMutateResult.FAIL;
}
this.handle.getPrimaryGroup().setStoredValue(group.toLowerCase());
return DataMutateResult.SUCCESS;
}