mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Fixed legacy skin servers not running asynchronously
This commit is contained in:
parent
67e756f6dd
commit
6648655830
1 changed files with 12 additions and 12 deletions
|
@ -45,20 +45,20 @@ public class LegacySkinServer implements SkinServer {
|
|||
|
||||
@Override
|
||||
public CompletableFuture<MinecraftTexturesPayload> getPreviewTextures(GameProfile profile) {
|
||||
try {
|
||||
return CallableFutures.asyncFailableFuture(() -> {
|
||||
SkinServer.verifyServerConnection(Minecraft.getMinecraft().getSession(), SERVER_ID);
|
||||
} catch (Exception e) {
|
||||
return CallableFutures.failedFuture(e);
|
||||
}
|
||||
|
||||
if (Strings.isNullOrEmpty(gateway)) {
|
||||
return CallableFutures.failedFuture(gatewayUnsupported());
|
||||
}
|
||||
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = new EnumMap<>(MinecraftProfileTexture.Type.class);
|
||||
for (MinecraftProfileTexture.Type type : MinecraftProfileTexture.Type.values()) {
|
||||
map.put(type, new MinecraftProfileTexture(getPath(gateway, type, profile), null));
|
||||
}
|
||||
return CompletableFuture.completedFuture(TexturesPayloadBuilder.createTexturesPayload(profile, map));
|
||||
if (Strings.isNullOrEmpty(gateway)) {
|
||||
throw gatewayUnsupported();
|
||||
}
|
||||
|
||||
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> map = new EnumMap<>(MinecraftProfileTexture.Type.class);
|
||||
for (MinecraftProfileTexture.Type type : MinecraftProfileTexture.Type.values()) {
|
||||
map.put(type, new MinecraftProfileTexture(getPath(gateway, type, profile), null));
|
||||
}
|
||||
|
||||
return TexturesPayloadBuilder.createTexturesPayload(profile, map);
|
||||
}, HDSkinManager.skinDownloadExecutor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue