Changed RelauchLibraryManager so that files with different paths on the
same baseURL can be implemented in one ILibrarySet.
This commit is contained in:
parent
c0795e9bee
commit
924425074f
1 changed files with 9 additions and 4 deletions
|
@ -85,13 +85,15 @@ public class RelaunchLibraryManager
|
||||||
{
|
{
|
||||||
boolean download = false;
|
boolean download = false;
|
||||||
String libName = lib.getLibraries()[i];
|
String libName = lib.getLibraries()[i];
|
||||||
|
File tmp = new File(libName);
|
||||||
|
String targFileName = tmp.getName();
|
||||||
String checksum = lib.getHashes()[i];
|
String checksum = lib.getHashes()[i];
|
||||||
File libFile = new File(libDir, libName);
|
File libFile = new File(libDir, targFileName);
|
||||||
if (!libFile.exists())
|
if (!libFile.exists())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
downloadFile(libFile, lib.getRootURL(), checksum);
|
downloadFile(libFile, lib.getRootURL(), libName, checksum);
|
||||||
download = true;
|
download = true;
|
||||||
}
|
}
|
||||||
catch (Throwable e)
|
catch (Throwable e)
|
||||||
|
@ -414,11 +416,14 @@ public class RelaunchLibraryManager
|
||||||
return coreModDir;
|
return coreModDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void downloadFile(File libFile, String rootUrl, String hash)
|
private static void downloadFile(File libFile, String rootUrl,String realFilePath, String hash)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
URL libDownload = new URL(String.format(rootUrl,libFile.getName()));
|
//rootUrl.replace("%s", libFile.getPath())
|
||||||
|
URL libDownload = new URL(String.format(rootUrl,realFilePath));
|
||||||
|
System.out.println("Downloading file: " + libDownload.getHost() + libDownload.getPath());
|
||||||
|
System.out.println("The libFile's path is " + libFile.getAbsolutePath());
|
||||||
String infoString = String.format("Downloading file %s", libDownload.toString());
|
String infoString = String.format("Downloading file %s", libDownload.toString());
|
||||||
downloadMonitor.updateProgressString(infoString);
|
downloadMonitor.updateProgressString(infoString);
|
||||||
FMLRelaunchLog.info(infoString);
|
FMLRelaunchLog.info(infoString);
|
||||||
|
|
Loading…
Reference in a new issue