I feel... dirty

This commit is contained in:
Sollace 2018-07-21 23:42:51 +02:00
parent 978d90be4e
commit f1a02fcf90
2 changed files with 7 additions and 12 deletions

View file

@ -205,18 +205,11 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
private Map<Type, MinecraftProfileTexture> loadProfileData(GameProfile profile) { private Map<Type, MinecraftProfileTexture> loadProfileData(GameProfile profile) {
Map<Type, MinecraftProfileTexture> textures = Maps.newEnumMap(Type.class); Map<Type, MinecraftProfileTexture> textures = Maps.newEnumMap(Type.class);
for (SkinServer server : skinServers) {
Optional<MinecraftTexturesPayload> profileData = server.loadProfileData(profile);
if (profileData.isPresent()) { skinServers.forEach(server -> server
profileData.get().getTextures().forEach(textures::putIfAbsent); .loadProfileData(profile)
} .map(MinecraftTexturesPayload::getTextures)
.ifPresent(a -> a.forEach(textures::putIfAbsent)));
if (textures.size() == Type.values().length) {
return textures;
}
}
return textures; return textures;
} }

View file

@ -32,7 +32,9 @@ public abstract class AbstractSkinServer implements SkinServer {
@Override @Override
public Map<Type, MinecraftProfileTexture> getPreviewTextures(GameProfile profile) { public Map<Type, MinecraftProfileTexture> getPreviewTextures(GameProfile profile) {
return loadProfileData(profile).map(MinecraftTexturesPayload::getTextures).orElse(Collections.emptyMap()); return loadProfileData(profile)
.map(MinecraftTexturesPayload::getTextures)
.orElse(Collections.emptyMap());
} }
@Override @Override