src/main/java/dev/gardeningtool/namemc/web/RequestUtil.java
@SneakyThrows
    public static String username(UUID uuid) throws IllegalArgumentException {
        Request request = getRequest("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid.toString());
        Map<?, ?> map = request.map();
        if (map == null) {
            throw new IllegalArgumentException(String.format("%s is not a valid UUID!", uuid.toString()));
        }
        return map.get("name").toString();
    }
/**
     * @param uuid The UUID of the target to obtain the username of
     * @return The username associated with the target UUID
     * @throws IllegalArgumentException If the UUID is invalid
     */
@param uuid The UUID of the target to obtain the username of
@return The username associated with the target UUID
@throws IllegalArgumentException If the UUID is invalid
@param uuid The UUID of the target to obtain the username of @return The username associated with the target UUID @throws IllegalArgumentException If the UUID is invalid
@SneakyThrows
    public static String username(UUID uuid) throws IllegalArgumentException {
        Request request = getRequest("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid.toString());
        Map<?, ?> map = request.map();
        if (map == null) {
            throw new IllegalArgumentException(String.format("%s is not a valid UUID!", uuid.toString()));
        }
        return map.get("name").toString();
    }
@ SneakyThrows public static String username ( UUID uuid ) throws IllegalArgumentException { Request request = getRequest ( "https://sessionserver.mojang.com/session/minecraft/profile/" + uuid . toString ( ) ) ; Map < ? , ? > map = request . map ( ) ; if ( map == null ) { throw new IllegalArgumentException ( String . format ( "%s is not a valid UUID!" , uuid . toString ( ) ) ) ; } return map . get ( "name" ) . toString ( ) ; }
@param uuid The UUID of the target to obtain the username of
 @return The username associated with the target UUID
 @throws IllegalArgumentException If the UUID is invalid
@param uuid The UUID of the target to obtain the username of @return The username associated with the target UUID @throws IllegalArgumentException If the UUID is invalid