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) {
Map<Type, MinecraftProfileTexture> textures = Maps.newEnumMap(Type.class);
for (SkinServer server : skinServers) {
Optional<MinecraftTexturesPayload> 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;
}

View file

@ -32,7 +32,9 @@ public abstract class AbstractSkinServer implements SkinServer {
@Override
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