/**
   * Get the list of metatmagic feats that the character can use.
   *
   * @param spellNode The spell the feats would be applied to.
   * @return The list of metamagic feats.
   */
  private List<InfoFacade> buildAvailableMetamagicFeatList(SpellNode spellNode) {
    List<Ability> characterMetaMagicFeats = new ArrayList<>();
    List<CNAbility> feats = pc.getCNAbilities(AbilityCategory.FEAT);

    for (CNAbility cna : feats) {
      Ability aFeat = cna.getAbility();
      if (aFeat.isType("Metamagic") // $NON-NLS-1$
          && !aFeat.getSafe(ObjectKey.VISIBILITY).isVisibleTo(View.HIDDEN_EXPORT)) {
        characterMetaMagicFeats.add(aFeat);
      }
    }
    Globals.sortPObjectListByName(characterMetaMagicFeats);

    if (!(spellNode.getSpell() instanceof SpellFacadeImplem)) {
      return Collections.emptyList();
    }
    List<InfoFacade> availableList = new ArrayList<>();
    availableList.addAll(characterMetaMagicFeats);
    return availableList;
  }