mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-12-01 16: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) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue