Example #1
0
  public static boolean isAllowed(String type, final String key) {
    if (KoLCharacter.isTrendy() && !TrendyRequest.isTrendy(type, key)) {
      return false;
    }
    if (!KoLCharacter.getRestricted()) {
      return true;
    }

    if (type.equals("Bookshelf")) {
      type = "Bookshelf Books";
    } else if (type.equals("Clan Item")) {
      type = "Clan Items";
    }

    if (type.equals("Bookshelf Books")) {
      // Work around a KoL bug: most restricted books are
      // listed both under Bookshelf Books and Items, but
      // 3 are listed under only one or the other.
      return StandardRequest.isNotRestricted("Bookshelf Books", key)
          && StandardRequest.isNotRestricted("Items", key);
    }

    List<String> list = StandardRequest.typeToList(type);
    return list != null && StandardRequest.isNotRestricted(list, key);
  }
Example #2
0
 public static boolean isNotRestricted(final String type, final String key) {
   if (!KoLCharacter.getRestricted()) {
     return true;
   }
   List<String> list = StandardRequest.typeToList(type);
   return list != null && StandardRequest.isNotRestricted(list, key);
 }