mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 15:37:59 +01:00
We really don't need any of this
This commit is contained in:
parent
f32611a1eb
commit
2d0a71edb8
5 changed files with 11 additions and 20 deletions
|
@ -206,10 +206,7 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
|
|||
Map<Type, MinecraftProfileTexture> textures = Maps.newEnumMap(Type.class);
|
||||
|
||||
for (SkinServer server : skinServers) {
|
||||
MinecraftTexturesPayload payload = server.getProfileData(profile);
|
||||
if (payload != null) {
|
||||
payload.getTextures().forEach(textures::putIfAbsent);
|
||||
}
|
||||
server.getProfileTextures(profile).forEach(textures::putIfAbsent);
|
||||
}
|
||||
|
||||
return textures;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class PreviewTextureManager {
|
|||
@Nullable
|
||||
private PreviewTexture loadPreviewTexture(ResourceLocation location, Type type, ResourceLocation def, @Nullable SkinAvailableCallback callback) {
|
||||
if (textures == null) {
|
||||
textures = HDSkinManager.INSTANCE.getGatewayServer().getPreviewTextures(profile);
|
||||
textures = HDSkinManager.INSTANCE.getGatewayServer().getProfileTextures(profile);
|
||||
}
|
||||
|
||||
if (!textures.containsKey(type)) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
|||
import java.net.URI;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
@ -32,15 +31,14 @@ public abstract class AbstractSkinServer implements SkinServer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final Optional<MinecraftTexturesPayload> loadProfileData(GameProfile profile) {
|
||||
return Optional.ofNullable(getProfileData(profile));
|
||||
}
|
||||
public Map<Type, MinecraftProfileTexture> getProfileTextures(GameProfile profile) {
|
||||
MinecraftTexturesPayload payload = getProfileData(profile);
|
||||
|
||||
@Override
|
||||
public Map<Type, MinecraftProfileTexture> getPreviewTextures(GameProfile profile) {
|
||||
return loadProfileData(profile)
|
||||
.map(MinecraftTexturesPayload::getTextures)
|
||||
.orElse(Collections.emptyMap());
|
||||
if (payload != null && payload.getTextures() != null) {
|
||||
return payload.getTextures();
|
||||
}
|
||||
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public class LegacySkinServer extends AbstractSkinServer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Type, MinecraftProfileTexture> getPreviewTextures(GameProfile profile) {
|
||||
public Map<Type, MinecraftProfileTexture> getProfileTextures(GameProfile profile) {
|
||||
Map<Type, MinecraftProfileTexture> map = new EnumMap<>(Type.class);
|
||||
|
||||
for (Type type : Type.values()) {
|
||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.util.Session;
|
|||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
|
@ -34,12 +33,9 @@ public interface SkinServer extends Exposable {
|
|||
"http://skins.voxelmodpack.com",
|
||||
"http://skinmanager.voxelmodpack.com"));
|
||||
|
||||
@Deprecated
|
||||
Optional<MinecraftTexturesPayload> loadProfileData(GameProfile profile);
|
||||
|
||||
MinecraftTexturesPayload getProfileData(GameProfile profile);
|
||||
|
||||
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getPreviewTextures(GameProfile profile);
|
||||
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getProfileTextures(GameProfile profile);
|
||||
|
||||
CompletableFuture<SkinUploadResponse> uploadSkin(Session session, @Nullable URI image, MinecraftProfileTexture.Type type, Map<String, String> metadata);
|
||||
|
||||
|
|
Loading…
Reference in a new issue