Enable HMCL to update mod from Modrinth (#2236)

* Enable HMCL to update mod from Modrinth

* Fix UI

* Fix: HMCL won't select the latest version when there is newer version in several remote mod repository.
This commit is contained in:
Burning_TNT
2023-06-23 18:15:16 +08:00
committed by GitHub
parent 501ecac4d5
commit d46efe8410
2 changed files with 36 additions and 14 deletions

View File

@@ -17,6 +17,8 @@
*/
package org.jackhuang.hmcl.mod;
import org.jackhuang.hmcl.mod.curse.CurseForgeRemoteModRepository;
import org.jackhuang.hmcl.mod.modrinth.ModrinthRemoteModRepository;
import org.jackhuang.hmcl.task.FileDownloadTask;
import java.io.IOException;
@@ -87,8 +89,18 @@ public class RemoteMod {
}
public enum Type {
CURSEFORGE,
MODRINTH
CURSEFORGE(CurseForgeRemoteModRepository.MODS),
MODRINTH(ModrinthRemoteModRepository.MODS);
private final RemoteModRepository remoteModRepository;
public RemoteModRepository getRemoteModRepository() {
return this.remoteModRepository;
}
Type(RemoteModRepository remoteModRepository) {
this.remoteModRepository = remoteModRepository;
}
}
public interface IMod {
@@ -201,7 +213,7 @@ public class RemoteMod {
}
public String getUrl() {
return encodeLocation (url);
return encodeLocation(url);
}
public String getFilename() {