From 2dc956b3576120cbd640a522bf1947cd3e977887 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Thu, 11 Oct 2018 22:05:24 +0800 Subject: [PATCH] Fix request mojang server for skin info every time --- .../java/org/jackhuang/hmcl/game/AccountHelper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java b/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java index e1ba4ef53..0f2934c38 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java @@ -140,12 +140,12 @@ public final class AccountHelper { private static void downloadSkin(YggdrasilAccount account, GameProfile profile, boolean refresh) throws Exception { account.clearCache(); - Optional texture = account.getSkin(profile); - if (!texture.isPresent()) return; - String url = texture.get().getUrl(); File file = getSkinFile(profile.getId()); if (!refresh && file.exists()) return; + Optional texture = account.getSkin(profile); + if (!texture.isPresent()) return; + String url = texture.get().getUrl(); new FileDownloadTask(NetworkUtils.toURL(url), file).run(); } @@ -153,12 +153,12 @@ public final class AccountHelper { account.clearCache(); if (account.getCharacter() == null) return; - Optional texture = account.getSkin(); - if (!texture.isPresent()) return; - String url = texture.get().getUrl(); File file = getSkinFile(account.getUUID()); if (!refresh && file.exists()) return; + Optional texture = account.getSkin(); + if (!texture.isPresent()) return; + String url = texture.get().getUrl(); new FileDownloadTask(NetworkUtils.toURL(url), file).run(); }