diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java index a94e9805..cb3d02a0 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/HDSkinManager.java @@ -161,7 +161,7 @@ public final class HDSkinManager implements IResourceManagerReloadListener { return skin == LOADING ? Optional.empty() : Optional.of(skin); } - private String bustCache(String url) { + public static String bustCache(String url) { return url + (url.indexOf('?') > -1 ? '&' : '?') + Long.toString(new Date().getTime() / 1000); } diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/PreviewTextureManager.java b/src/hdskins/java/com/voxelmodpack/hdskins/PreviewTextureManager.java index 7848be5e..045e7329 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/PreviewTextureManager.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/PreviewTextureManager.java @@ -29,14 +29,14 @@ public class PreviewTextureManager { } MinecraftProfileTexture texture = textures.get(type); - + String url = HDSkinManager.bustCache(texture.getUrl()); ISkinAvailableCallback buff = new ImageBufferDownloadHD(type, () -> { if (callback != null) { - callback.skinAvailable(type, location, new MinecraftProfileTexture(texture.getUrl(), Maps.newHashMap())); + callback.skinAvailable(type, location, new MinecraftProfileTexture(url, Maps.newHashMap())); } }); - PreviewTexture skinTexture = new PreviewTexture(texture.getMetadata("model"), texture.getUrl(), def, buff); + PreviewTexture skinTexture = new PreviewTexture(texture.getMetadata("model"), url, def, buff); TextureLoader.loadTexture(location, skinTexture); diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/SkinUploader.java b/src/hdskins/java/com/voxelmodpack/hdskins/SkinUploader.java index 01f0f863..f6ee5b66 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/SkinUploader.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/SkinUploader.java @@ -192,7 +192,7 @@ public class SkinUploader implements Closeable { } public CompletableFuture downloadSkin() { - String loc = remotePlayer.getLocal(skinType).getRemote().getUrl(); + String loc = HDSkinManager.bustCache(remotePlayer.getLocal(skinType).getRemote().getUrl()); return new NetClient("GET", loc).async(HDSkinManager.skinDownloadExecutor); }