mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 14:27:59 +01:00
Bust the cache. Always bust the cache. Serious I am sick of this cache.
This commit is contained in:
parent
ee61b56ceb
commit
f90814a730
3 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue