From 3dce2be978fe661b1addaa424592c8ec46474d19 Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Tue, 20 Dec 2016 01:36:34 -0500 Subject: [PATCH] Don't "convert" a skin if it's an elytra or cape. --- .../com/voxelmodpack/hdskins/HDSkinManager.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java index da0869f2..c05a62ad 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java @@ -124,22 +124,25 @@ public final class HDSkinManager implements IResourceManagerReloadListener { return; } - String skinDir = "hd" + type.toString().toLowerCase() + "s/"; - final ResourceLocation skin = new ResourceLocation(skinDir + texture.getHash()); - File file1 = new File(new File("assets/" + skinDir), texture.getHash().substring(0, 2)); - File file2 = new File(file1, texture.getHash()); - final IImageBuffer imagebufferdownload = new ImageBufferDownloadHD(); + String skinDir = type.toString().toLowerCase() + "s/"; + final ResourceLocation skin = new ResourceLocation("hdskins", skinDir + texture.getHash()); + File file2 = new File(LiteLoader.getAssetsDirectory(), "hd" + skinDir + "/" + texture.getHash().substring(0, 2) + "/" + texture.getHash()); + final IImageBuffer imagebufferdownload = type == Type.SKIN ? new ImageBufferDownloadHD() : null; ThreadDownloadImageData threaddownloadimagedata = new ThreadDownloadImageData(file2, texture.getUrl(), DefaultPlayerSkin.getDefaultSkinLegacy(), new IImageBuffer() { @Override public BufferedImage parseUserSkin(BufferedImage image) { - return imagebufferdownload.parseUserSkin(image); + if (imagebufferdownload != null) + return imagebufferdownload.parseUserSkin(image); + return image; } @Override public void skinAvailable() { - imagebufferdownload.skinAvailable(); + if (imagebufferdownload != null) { + imagebufferdownload.skinAvailable(); + } if (callback != null) { callback.skinAvailable(type, skin, texture); }