use of net.luckperms.api.node.types.InheritanceNode in project AuthMeReloaded by AuthMe.
the class LuckPermsHandler method removeFromGroup.
@Override
public boolean removeFromGroup(OfflinePlayer player, UserGroup group) {
String playerName = player.getName();
if (playerName == null) {
return false;
}
User user = luckPerms.getUserManager().getUser(playerName);
if (user == null) {
logger.warning("LuckPermsHandler: tried to remove group for offline user " + player.getName() + " but it isn't loaded!");
return false;
}
InheritanceNode groupNode = InheritanceNode.builder(group.getGroupName()).build();
boolean result = user.data().remove(groupNode) != DataMutateResult.FAIL;
luckPerms.getUserManager().saveUser(user);
return result;
}
Aggregations