Trace, and don't bother hitting other servers if you have all your data

This commit is contained in:
Sollace 2018-08-06 20:38:27 +02:00
parent b496529ed8
commit 356a9657bb
2 changed files with 6 additions and 2 deletions

View file

@ -206,6 +206,9 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
for (SkinServer server : skinServers) {
server.getProfileTextures(profile).forEach(textures::putIfAbsent);
if (textures.size() == Type.values().length) {
return textures;
}
}
return textures;

View file

@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.util.Strings;
import com.google.gson.JsonParseException;
@ -35,8 +36,8 @@ public abstract class AbstractSkinServer implements SkinServer {
if (payload != null && payload.getTextures() != null) {
return payload.getTextures();
}
} catch (IOException ignored) {
} catch (IOException e) {
LogManager.getLogger().trace(e);
}
return Collections.emptyMap();