From f1a02fcf90177533261f9b77ebee30a1081c07c1 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 21 Jul 2018 23:42:51 +0200 Subject: [PATCH] I feel... dirty --- .../com/voxelmodpack/hdskins/HDSkinManager.java | 15 ++++----------- .../hdskins/server/AbstractSkinServer.java | 4 +++- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java index a1841c99..9b4747e1 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java @@ -205,18 +205,11 @@ public final class HDSkinManager implements IResourceManagerReloadListener { private Map loadProfileData(GameProfile profile) { Map textures = Maps.newEnumMap(Type.class); - for (SkinServer server : skinServers) { - Optional profileData = server.loadProfileData(profile); - if (profileData.isPresent()) { - profileData.get().getTextures().forEach(textures::putIfAbsent); - } - - if (textures.size() == Type.values().length) { - return textures; - } - - } + skinServers.forEach(server -> server + .loadProfileData(profile) + .map(MinecraftTexturesPayload::getTextures) + .ifPresent(a -> a.forEach(textures::putIfAbsent))); return textures; } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/server/AbstractSkinServer.java b/src/hdskins/java/com/voxelmodpack/hdskins/server/AbstractSkinServer.java index 25f2bc7f..99b50ebe 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/server/AbstractSkinServer.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/server/AbstractSkinServer.java @@ -32,7 +32,9 @@ public abstract class AbstractSkinServer implements SkinServer { @Override public Map getPreviewTextures(GameProfile profile) { - return loadProfileData(profile).map(MinecraftTexturesPayload::getTextures).orElse(Collections.emptyMap()); + return loadProfileData(profile) + .map(MinecraftTexturesPayload::getTextures) + .orElse(Collections.emptyMap()); } @Override