|
25 | 25 |
|
26 | 26 | import java.util.MissingResourceException; |
27 | 27 |
|
| 28 | +import static org.jackhuang.hmcl.setting.ConfigHolder.config; |
28 | 29 | import static org.jackhuang.hmcl.util.i18n.I18n.i18n; |
29 | 30 | import static org.jackhuang.hmcl.util.logging.Logger.LOG; |
30 | 31 |
|
@@ -62,17 +63,29 @@ private HMCLLocalizedDownloadListPage(DownloadPage.DownloadCallback callback, bo |
62 | 63 |
|
63 | 64 | supportChinese.set(true); |
64 | 65 |
|
| 66 | + boolean supportedCurseForge = CurseForgeRemoteModRepository.isAvailable() && curseForge != null; |
| 67 | + |
65 | 68 | downloadSources.setAll("mods.modrinth"); |
66 | | - if (CurseForgeRemoteModRepository.isAvailable()) { |
| 69 | + if (supportedCurseForge) { |
67 | 70 | downloadSources.add("mods.curseforge"); |
68 | 71 | } |
69 | 72 |
|
70 | | - if (modrinth != null) { |
71 | | - downloadSource.set("mods.modrinth"); |
72 | | - } else if (curseForge != null) { |
73 | | - downloadSource.set("mods.curseforge"); |
| 73 | + if ("curseforge".equalsIgnoreCase(config().getDefaultAddonSource())) { |
| 74 | + if (supportedCurseForge) { |
| 75 | + downloadSource.set("mods.curseforge"); |
| 76 | + } else if (modrinth != null) { |
| 77 | + downloadSource.set("mods.modrinth"); |
| 78 | + } else { |
| 79 | + throw new AssertionError("Should not be here."); |
| 80 | + } |
74 | 81 | } else { |
75 | | - throw new AssertionError("Should not be here."); |
| 82 | + if (modrinth != null) { |
| 83 | + downloadSource.set("mods.modrinth"); |
| 84 | + } else if (supportedCurseForge) { |
| 85 | + downloadSource.set("mods.curseforge"); |
| 86 | + } else { |
| 87 | + throw new AssertionError("Should not be here."); |
| 88 | + } |
76 | 89 | } |
77 | 90 | } |
78 | 91 |
|
|
0 commit comments