Merge branch 'master' into hdskins_rewrites

This commit is contained in:
Sollace 2018-08-08 08:24:23 +02:00
commit 44ffb2362f
4 changed files with 7 additions and 6 deletions

View file

@ -34,6 +34,9 @@ import net.minecraft.client.resources.IResourceManagerReloadListener;
import net.minecraft.client.resources.SkinManager.SkinAvailableCallback;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.io.FileUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.logging.log4j.LogManager;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
@ -48,6 +51,7 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

View file

@ -20,7 +20,6 @@ import net.minecraft.util.ResourceLocation;
import java.io.File;
import java.util.Map;
@SuppressWarnings("EntityConstructor")
public class EntityPlayerModel extends EntityLivingBase implements IBlankSkinSupplier {

View file

@ -10,7 +10,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.util.stream.Stream;
@ -52,13 +52,13 @@ public interface MoreHttpResponses extends AutoCloseable {
}
default <T> T json(Class<T> type) throws IOException {
try (Reader reader = new InputStreamReader(getResponse().getEntity().getContent())) {
try (BufferedReader reader = getReader()) {
return SkinServer.gson.fromJson(reader, type);
}
}
default <T> T json(Type type) throws IOException {
try (Reader reader = new InputStreamReader(getResponse().getEntity().getContent())) {
try (BufferedReader reader = getReader()) {
return SkinServer.gson.fromJson(reader, type);
}
}

View file

@ -37,12 +37,10 @@ public class ValhallaSkinServer extends AbstractSkinServer {
super(address);
}
@Override
public MinecraftTexturesPayload getProfileData(GameProfile profile) throws IOException {
try (MoreHttpResponses response = MoreHttpResponses.execute(NetClient.nativeClient(), new HttpGet(getTexturesURI(profile)))) {
if (response.ok()) {
return readJson(response, MinecraftTexturesPayload.class);
}