mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-18 17:19:15 +00:00
Added Http Cache
Use new http request platform
This commit is contained in:
1 parent
87a40fc3c7
commit
bdead01ef9
9 files changed
+273
-145
No files matched your search
@@ -35,11 +35,9 @@ public class HttpTextureUtil {
|
||||
}
|
||||
if(fakeUrl.startsWith(LOCAL_LEGACY_MARK)){
|
||||
fakeUrl=fakeUrl.replaceFirst(LOCAL_LEGACY_MARK, "");
|
||||
String[] t=fakeUrl.split(",",2);
|
||||
if(t.length!=2)
|
||||
return info;
|
||||
info.cacheFile=new File(CustomSkinLoader.DATA_DIR,t[1]);
|
||||
info.hash=t[0];
|
||||
info.url=fakeUrl;
|
||||
info.hash=DigestUtils.sha1Hex(info.url);;
|
||||
info.cacheFile=HttpTextureUtil.getCacheFile(info.hash);
|
||||
return info;
|
||||
}
|
||||
if(fakeUrl.startsWith(LOCAL_MARK)){
|
||||
@@ -61,8 +59,8 @@ public class HttpTextureUtil {
|
||||
return info;
|
||||
}
|
||||
|
||||
public static String getLegacyFakeUrl(String url,String hash){
|
||||
return LEGACY_MARK+hash+","+url;
|
||||
public static String getLegacyFakeUrl(String url){
|
||||
return LEGACY_MARK+url;
|
||||
}
|
||||
public static String getLocalFakeUrl(String path){
|
||||
return LOCAL_MARK+path;
|
||||
|
||||
Reference in new issue
Block a user