mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 07:27:59 +01:00
I feel... dirty
This commit is contained in:
parent
978d90be4e
commit
f1a02fcf90
2 changed files with 7 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue