diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java index 78f18c38..606c1200 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java @@ -205,10 +205,12 @@ public final class HDSkinManager implements IResourceManagerReloadListener { private Map loadProfileData(GameProfile profile) { Map textures = Maps.newEnumMap(Type.class); - skinServers.forEach(server -> server - .loadProfileData(profile) - .map(MinecraftTexturesPayload::getTextures) - .ifPresent(a -> a.forEach(textures::putIfAbsent))); + for (SkinServer server : skinServers) { + MinecraftTexturesPayload payload = server.getProfileData(profile); + if (payload != null) { + payload.getTextures().forEach(textures::putIfAbsent); + } + } return textures; } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/AbstractSkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/AbstractSkinServer.java index 5196d443..1a0ad258 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/AbstractSkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/AbstractSkinServer.java @@ -57,8 +57,6 @@ public abstract class AbstractSkinServer implements SkinServer { } } - protected abstract MinecraftTexturesPayload getProfileData(GameProfile profile); - protected abstract SkinUploadResponse doUpload(Session session, URI image, Type type, Map metadata) throws AuthenticationException, IOException; @Override diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java index 8fd33315..eb6f235c 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/BethlehemSkinServer.java @@ -26,7 +26,7 @@ public class BethlehemSkinServer extends AbstractSkinServer { } @Override - protected MinecraftTexturesPayload getProfileData(GameProfile profile) { + public MinecraftTexturesPayload getProfileData(GameProfile profile) { try (NetClient client = new NetClient("GET", getPath(profile))) { if (client.getResponseCode() == HttpStatus.SC_OK) { return gson.fromJson(client.getResponseText(), MinecraftTexturesPayload.class); diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java index 1657d17e..542cd6fb 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java @@ -51,7 +51,7 @@ public class LegacySkinServer extends AbstractSkinServer { @SuppressWarnings("deprecation") @Override - protected MinecraftTexturesPayload getProfileData(GameProfile profile) { + public MinecraftTexturesPayload getProfileData(GameProfile profile) { ImmutableMap.Builder builder = ImmutableMap.builder(); for (Type type : Type.values()) { diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/SkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/SkinServer.java index 10cd6e58..0eedeb25 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/SkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/SkinServer.java @@ -34,8 +34,11 @@ public interface SkinServer extends Exposable { "http://skins.voxelmodpack.com", "http://skinmanager.voxelmodpack.com")); + @Deprecated Optional loadProfileData(GameProfile profile); + MinecraftTexturesPayload getProfileData(GameProfile profile); + Map getPreviewTextures(GameProfile profile); CompletableFuture uploadSkin(Session session, @Nullable URI image, MinecraftProfileTexture.Type type, Map metadata); diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java index 85f17c47..7516a119 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/ValhallaSkinServer.java @@ -47,11 +47,12 @@ public class ValhallaSkinServer extends AbstractSkinServer { } @Override - protected MinecraftTexturesPayload getProfileData(GameProfile profile) { - try (CloseableHttpClient client = HttpClients.createSystem(); - CloseableHttpResponse response = client.execute(new HttpGet(getTexturesURI(profile)))) { - if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { - return readJson(response, MinecraftTexturesPayload.class); + public MinecraftTexturesPayload getProfileData(GameProfile profile) { + try (CloseableHttpClient client = HttpClients.createSystem()) { + try (CloseableHttpResponse response = client.execute(new HttpGet(getTexturesURI(profile)))) { + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + return readJson(response, MinecraftTexturesPayload.class); + } } } catch (IOException e) {