private CallbackTask getImage(final String user) {
return new CallbackTask(new Callable<BufferedImage>() {
public BufferedImage call() throws Exception {
try {
System.out.println("Attempting to grab avatar helm for " + user + "...");
InputStream stream = RestAPI.getCache().get(new URL("https://minotar.net/helm/" + user + "/100"), new DownloadURLConnector() {
@Override
public void setHeaders(URLConnection conn) {
conn.setDoInput(true);
conn.setDoOutput(false);
System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19");