Bust the cache. Always bust the cache. Serious I am sick of this cache.

This commit is contained in:
Sollace 2018-08-23 00:45:53 +02:00
parent ee61b56ceb
commit f90814a730
3 changed files with 5 additions and 5 deletions

View file

@ -161,7 +161,7 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
return skin == LOADING ? Optional.empty() : Optional.of(skin); 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); return url + (url.indexOf('?') > -1 ? '&' : '?') + Long.toString(new Date().getTime() / 1000);
} }

View file

@ -29,14 +29,14 @@ public class PreviewTextureManager {
} }
MinecraftProfileTexture texture = textures.get(type); MinecraftProfileTexture texture = textures.get(type);
String url = HDSkinManager.bustCache(texture.getUrl());
ISkinAvailableCallback buff = new ImageBufferDownloadHD(type, () -> { ISkinAvailableCallback buff = new ImageBufferDownloadHD(type, () -> {
if (callback != null) { 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); TextureLoader.loadTexture(location, skinTexture);

View file

@ -192,7 +192,7 @@ public class SkinUploader implements Closeable {
} }
public CompletableFuture<MoreHttpResponses> downloadSkin() { public CompletableFuture<MoreHttpResponses> 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); return new NetClient("GET", loc).async(HDSkinManager.skinDownloadExecutor);
} }