src/main/java/dev/gardeningtool/namemc/web/RequestUtil.java
@SneakyThrows
    public static List<Friend> friends(UUID uuid) {
        Request request = getRequest(String.format("https://api.namemc.com/profile/%s/friends/", uuid.toString()));
        JsonArray array = request.toJsonArray();
        List<Friend> friends = new ArrayList<>();
        for(JsonElement element : array) {
            JsonObject object = element.getAsJsonObject();
            friends.add(new Friend(UUID.fromString(object.get("uuid").getAsString()), object.get("name").getAsString()));
        }
        return friends;
    }
/**
     * @param uuid The UUID of the player to obtain the friends of
     * @return The players that the player in the argument has added on NameMC
     */
@param uuid The UUID of the player to obtain the friends of
@return The players that the player in the argument has added on NameMC
@param uuid The UUID of the player to obtain the friends of @return The players that the player in the argument has added on NameMC
@SneakyThrows
    public static List<Friend> friends(UUID uuid) {
        Request request = getRequest(String.format("https://api.namemc.com/profile/%s/friends/", uuid.toString()));
        JsonArray array = request.toJsonArray();
        List<Friend> friends = new ArrayList<>();
        for(JsonElement element : array) {
            JsonObject object = element.getAsJsonObject();
            friends.add(new Friend(UUID.fromString(object.get("uuid").getAsString()), object.get("name").getAsString()));
        }
        return friends;
    }
@ SneakyThrows public static List < Friend > friends ( UUID uuid ) { Request request = getRequest ( String . format ( "https://api.namemc.com/profile/%s/friends/" , uuid . toString ( ) ) ) ; JsonArray array = request . toJsonArray ( ) ; List < Friend > friends = new ArrayList < > ( ) ; for ( JsonElement element : array ) { JsonObject object = element . getAsJsonObject ( ) ; friends . add ( new Friend ( UUID . fromString ( object . get ( "uuid" ) . getAsString ( ) ) , object . get ( "name" ) . getAsString ( ) ) ) ; } return friends ; }
@param uuid The UUID of the player to obtain the friends of
 @return The players that the player in the argument has added on NameMC
@param uuid The UUID of the player to obtain the friends of @return The players that the player in the argument has added on NameMC