Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import org.jackhuang.hmcl.download.cleanroom.CleanroomInstallTask;
import org.jackhuang.hmcl.download.fabric.FabricAPIInstallTask;
import org.jackhuang.hmcl.download.fabric.FabricInstallTask;
import org.jackhuang.hmcl.download.fabriclike.ModrinthComponentInstallTask;
import org.jackhuang.hmcl.download.forge.ForgeNewInstallTask;
import org.jackhuang.hmcl.download.forge.ForgeOldInstallTask;
import org.jackhuang.hmcl.download.game.GameAssetDownloadTask;
Expand All @@ -46,7 +46,6 @@
import org.jackhuang.hmcl.download.neoforge.NeoForgeInstallTask;
import org.jackhuang.hmcl.download.neoforge.NeoForgeOldInstallTask;
import org.jackhuang.hmcl.download.optifine.OptiFineInstallTask;
import org.jackhuang.hmcl.download.quilt.QuiltAPIInstallTask;
import org.jackhuang.hmcl.download.quilt.QuiltInstallTask;
import org.jackhuang.hmcl.game.HMCLModpackInstallTask;
import org.jackhuang.hmcl.java.JavaInstallTask;
Expand Down Expand Up @@ -171,7 +170,7 @@ public void onRunning(Task<?> task) {
} else if (task instanceof CleanroomInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.cleanroom")));
} else if (task instanceof LegacyFabricInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.legacyfabric")));
task.setName(i18n("install.installer.install", i18n("install.installer.legacy-fabric")));
} else if (task instanceof ForgeNewInstallTask || task instanceof ForgeOldInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.forge")));
} else if (task instanceof NeoForgeInstallTask || task instanceof NeoForgeOldInstallTask) {
Expand All @@ -182,12 +181,10 @@ public void onRunning(Task<?> task) {
task.setName(i18n("install.installer.install", i18n("install.installer.optifine")));
} else if (task instanceof FabricInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.fabric")));
} else if (task instanceof FabricAPIInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.fabric-api")));
} else if (task instanceof ModrinthComponentInstallTask modrinthComponentInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer." + modrinthComponentInstallTask.getVersion().projectId())));
} else if (task instanceof QuiltInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.quilt")));
} else if (task instanceof QuiltAPIInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.quilt-api")));
} else if (task instanceof CurseCompletionTask || task instanceof ModrinthCompletionTask || task instanceof ServerModpackCompletionTask || task instanceof McbbsModpackCompletionTask) {
task.setName(i18n("modpack.completion"));
} else if (task instanceof ModpackInstallTask) {
Expand Down Expand Up @@ -453,8 +450,8 @@ private StageNode(String stage) {
case "hmcl.install.optifine" -> i18n("install.installer.install", i18n("install.installer.optifine") + " " + stageValue);
case "hmcl.install.fabric" -> i18n("install.installer.install", i18n("install.installer.fabric") + " " + stageValue);
case "hmcl.install.fabric-api" -> i18n("install.installer.install", i18n("install.installer.fabric-api") + " " + stageValue);
case "hmcl.install.legacyfabric" -> i18n("install.installer.install", i18n("install.installer.legacyfabric") + " " + stageValue);
case "hmcl.install.legacyfabric-api" -> i18n("install.installer.install", i18n("install.installer.legacyfabric-api") + " " + stageValue);
case "hmcl.install.legacyfabric" -> i18n("install.installer.install", i18n("install.installer.legacy-fabric") + " " + stageValue);
case "hmcl.install.legacyfabric-api" -> i18n("install.installer.install", i18n("install.installer.legacy-fabric-api") + " " + stageValue);
case "hmcl.install.quilt" -> i18n("install.installer.install", i18n("install.installer.quilt") + " " + stageValue);
case "hmcl.install.quilt-api" -> i18n("install.installer.install", i18n("install.installer.quilt-api") + " " + stageValue);
default -> i18n(stageKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.*;
import org.jackhuang.hmcl.download.DownloadProvider;
import org.jackhuang.hmcl.download.ComponentRemoteVersion;
import org.jackhuang.hmcl.download.ComponentVersionList;
import org.jackhuang.hmcl.download.DownloadProvider;
import org.jackhuang.hmcl.download.cleanroom.CleanroomRemoteVersion;
import org.jackhuang.hmcl.download.fabric.FabricAPIRemoteVersion;
import org.jackhuang.hmcl.download.fabric.FabricRemoteVersion;
import org.jackhuang.hmcl.download.fabriclike.ModrinthComponentRemoteVersion;
import org.jackhuang.hmcl.download.forge.ForgeRemoteVersion;
import org.jackhuang.hmcl.download.game.GameRemoteVersion;
import org.jackhuang.hmcl.download.legacyfabric.LegacyFabricAPIRemoteVersion;
import org.jackhuang.hmcl.download.legacyfabric.LegacyFabricRemoteVersion;
import org.jackhuang.hmcl.download.liteloader.LiteLoaderRemoteVersion;
import org.jackhuang.hmcl.download.neoforge.NeoForgeRemoteVersion;
import org.jackhuang.hmcl.download.optifine.OptiFineRemoteVersion;
import org.jackhuang.hmcl.download.quilt.QuiltAPIRemoteVersion;
import org.jackhuang.hmcl.download.quilt.QuiltRemoteVersion;
import org.jackhuang.hmcl.game.GameComponentType;
import org.jackhuang.hmcl.setting.GameInstanceIconType;
Expand Down Expand Up @@ -279,12 +277,20 @@ else if (remoteVersion instanceof CleanroomRemoteVersion)
iconType = GameInstanceIconType.CLEANROOM;
else if (remoteVersion instanceof NeoForgeRemoteVersion)
iconType = GameInstanceIconType.NEO_FORGE;
else if (remoteVersion instanceof LegacyFabricRemoteVersion || remoteVersion instanceof LegacyFabricAPIRemoteVersion)
else if (remoteVersion instanceof LegacyFabricRemoteVersion)
iconType = GameInstanceIconType.LEGACY_FABRIC;
else if (remoteVersion instanceof FabricRemoteVersion || remoteVersion instanceof FabricAPIRemoteVersion)
else if (remoteVersion instanceof FabricRemoteVersion)
iconType = GameInstanceIconType.FABRIC;
else if (remoteVersion instanceof QuiltRemoteVersion || remoteVersion instanceof QuiltAPIRemoteVersion)
else if (remoteVersion instanceof QuiltRemoteVersion)
iconType = GameInstanceIconType.QUILT;
else if (remoteVersion instanceof ModrinthComponentRemoteVersion modrinthComponentRemoteVersion) {
iconType = switch (modrinthComponentRemoteVersion.getComponentType()) {
case LEGACY_FABRIC_API -> GameInstanceIconType.LEGACY_FABRIC;
case FABRIC_API -> GameInstanceIconType.FABRIC;
case QUILT_API -> GameInstanceIconType.QUILT;
default -> GameInstanceIconType.COMMAND;
};
}
else
iconType = GameInstanceIconType.COMMAND;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.FileChooser;
import org.jackhuang.hmcl.download.DownloadProvider;
import org.jackhuang.hmcl.game.*;
import org.jackhuang.hmcl.addon.mod.ModLoaderType;
import org.jackhuang.hmcl.addon.RemoteAddon;
import org.jackhuang.hmcl.addon.RemoteAddonRepository;
import org.jackhuang.hmcl.addon.mod.ModLoaderType;
import org.jackhuang.hmcl.download.DownloadProvider;
import org.jackhuang.hmcl.game.GameInstanceID;
import org.jackhuang.hmcl.game.HMCLGameInstance;
import org.jackhuang.hmcl.game.HMCLGameRepository;
import org.jackhuang.hmcl.task.FileDownloadTask;
import org.jackhuang.hmcl.task.Schedulers;
import org.jackhuang.hmcl.task.Task;
Expand Down Expand Up @@ -481,7 +483,7 @@ private static final class AddonItem extends StackPane {
content.addTag(i18n("install.installer.quilt"));
break;
case LEGACY_FABRIC:
content.addTag(i18n("install.installer.legacyfabric"));
content.addTag(i18n("install.installer.legacy-fabric"));
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
import javafx.util.Duration;
import org.jackhuang.hmcl.addon.RemoteAddon;
import org.jackhuang.hmcl.addon.RemoteAddonRepository;
import org.jackhuang.hmcl.addon.repository.CurseForgeRemoteAddonRepository;
import org.jackhuang.hmcl.addon.repository.ModrinthRemoteAddonRepository;
import org.jackhuang.hmcl.game.*;
import org.jackhuang.hmcl.addon.mod.LocalModFile;
import org.jackhuang.hmcl.addon.mod.ModLoaderType;
import org.jackhuang.hmcl.addon.mod.ModManager;
import org.jackhuang.hmcl.addon.repository.CurseForgeRemoteAddonRepository;
import org.jackhuang.hmcl.addon.repository.ModrinthRemoteAddonRepository;
import org.jackhuang.hmcl.game.*;
import org.jackhuang.hmcl.setting.DownloadProviders;
import org.jackhuang.hmcl.setting.GameDirectory;
import org.jackhuang.hmcl.setting.GameInstanceIconType;
Expand All @@ -75,7 +75,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.Objects;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.locks.ReentrantLock;
Expand Down Expand Up @@ -739,7 +738,7 @@ private static final class ModInfoDialog extends JFXDialogLayout {
String loaderName = switch (modLoaderType) {
case FORGE -> i18n("install.installer.forge");
case CLEANROOM -> i18n("install.installer.cleanroom");
case LEGACY_FABRIC -> i18n("install.installer.legacyfabric");
case LEGACY_FABRIC -> i18n("install.installer.legacy-fabric");
case NEO_FORGE -> i18n("install.installer.neoforge");
case FABRIC -> i18n("install.installer.fabric");
case LITE_LOADER -> i18n("install.installer.liteloader");
Expand Down Expand Up @@ -894,7 +893,7 @@ protected void updateControl(ModInfoObject dataItem, boolean empty) {
warning.add(i18n("mods.warning.loader_mismatch"));
switch (dataItem.getModInfo().getModLoaderType()) {
case FORGE -> content.addTagWarning(i18n("install.installer.forge"));
case LEGACY_FABRIC -> content.addTagWarning(i18n("install.installer.legacyfabric"));
case LEGACY_FABRIC -> content.addTagWarning(i18n("install.installer.legacy-fabric"));
case CLEANROOM -> content.addTagWarning(i18n("install.installer.cleanroom"));
case NEO_FORGE -> content.addTagWarning(i18n("install.installer.neoforge"));
case FABRIC -> content.addTagWarning(i18n("install.installer.fabric"));
Expand Down
2 changes: 1 addition & 1 deletion HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ install.installer.do_not_install=Do not install
install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API
install.installer.legacyfabric=Legacy Fabric
install.installer.legacyfabric-api=Legacy Fabric API
install.installer.legacy-fabric-api=Legacy Fabric API
install.installer.fabric-quilt-api.warning=%1$s is a mod and will be installed into the mod directory of the game instance. Please do not change the working directory of the game, or the %1$s will not function. If you do want to change the directory, you should reinstall it.
install.installer.forge=Forge
install.installer.neoforge=NeoForge
Expand Down
2 changes: 1 addition & 1 deletion HMCL/src/main/resources/assets/lang/I18N_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ install.installer.do_not_install=لا تثبّت
install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API
install.installer.legacyfabric=Legacy Fabric
install.installer.legacyfabric-api=Legacy Fabric API
install.installer.legacy-fabric-api=Legacy Fabric API
install.installer.fabric-quilt-api.warning=%1$s هو مود وسيتم تثبيته في مجلد مودات نسخة اللعبة. يُرجى عدم تغيير مجلد عمل اللعبة، وإلا لن يعمل %1$s. إذا أردت تغيير المجلد، يجب إعادة تثبيته.
install.installer.forge=Forge
install.installer.neoforge=NeoForge
Expand Down
2 changes: 1 addition & 1 deletion HMCL/src/main/resources/assets/lang/I18N_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ install.installer.do_not_install=Nicht installieren
install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API
install.installer.legacyfabric=Legacy Fabric
install.installer.legacyfabric-api=Legacy Fabric API
install.installer.legacy-fabric-api=Legacy Fabric API
install.installer.fabric-quilt-api.warning=%1$s ist ein Mod und wird in das Mod-Verzeichnis der Spielinstanz installiert. Bitte ändern Sie das Arbeitsverzeichnis des Spiels nicht, da der %1$s sonst nicht funktioniert. Wenn Sie das Verzeichnis ändern möchten, sollten Sie es neu installieren.
install.installer.forge=Forge
install.installer.neoforge=NeoForge
Expand Down
2 changes: 1 addition & 1 deletion HMCL/src/main/resources/assets/lang/I18N_uk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API
install.installer.fabric-quilt-api.warning=%1$s - це мод, і він буде встановлений у каталог модів екземпляра гри. Не змінюйте робочий каталог гри, інакше %1$s не працюватиме. Якщо ви все ж хочете змінити каталог, вам слід перевстановити його.
install.installer.legacyfabric=Legacy Fabric
install.installer.legacyfabric-api=Legacy Fabric API
install.installer.legacy-fabric-api=Legacy Fabric API
install.installer.forge=Forge
install.installer.neoforge=NeoForge
install.installer.game=Minecraft
Expand Down
2 changes: 1 addition & 1 deletion HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ install.installer.do_not_install=不安裝
install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API
install.installer.legacyfabric=Legacy Fabric
install.installer.legacyfabric-api=Legacy Fabric API
install.installer.legacy-fabric-api=Legacy Fabric API
install.installer.fabric-quilt-api.warning=%1$s 是一個模組,將會被安裝到新遊戲的模組目錄。請你在安裝遊戲後不要修改目前遊戲的「執行路徑」設定。如果你在之後修改了相關設定,則需要重新安裝 %1$s。
install.installer.forge=Forge
install.installer.neoforge=NeoForge
Expand Down
2 changes: 1 addition & 1 deletion HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ install.installer.cleanroom=Cleanroom
install.installer.do_not_install=不安装
install.installer.fabric=Fabric
install.installer.legacyfabric=Legacy Fabric
install.installer.legacyfabric-api=Legacy Fabric API
install.installer.legacy-fabric-api=Legacy Fabric API
install.installer.fabric-api=Fabric API
install.installer.fabric-quilt-api.warning=%1$s 是一个模组,将会被安装到新游戏的模组文件夹。请你在安装游戏后不要修改当前游戏的“版本隔离”设置。如果你在之后修改了相关设置,则需要重新安装 %1$s。
install.installer.forge=Forge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
package org.jackhuang.hmcl.download;

import org.jackhuang.hmcl.download.cleanroom.CleanroomVersionList;
import org.jackhuang.hmcl.download.fabric.FabricAPIVersionList;
import org.jackhuang.hmcl.download.fabric.FabricVersionList;
import org.jackhuang.hmcl.download.fabriclike.ModrinthComponentVersionList;
import org.jackhuang.hmcl.download.forge.ForgeBMCLVersionList;
import org.jackhuang.hmcl.download.game.GameVersionList;
import org.jackhuang.hmcl.download.legacyfabric.LegacyFabricAPIVersionList;
import org.jackhuang.hmcl.download.legacyfabric.LegacyFabricVersionList;
import org.jackhuang.hmcl.download.liteloader.LiteLoaderBMCLVersionList;
import org.jackhuang.hmcl.download.neoforge.NeoForgeBMCLVersionList;
import org.jackhuang.hmcl.download.optifine.OptiFineBMCLVersionList;
import org.jackhuang.hmcl.download.quilt.QuiltAPIVersionList;
import org.jackhuang.hmcl.download.quilt.QuiltVersionList;
import org.jackhuang.hmcl.game.GameComponentType;
import org.jackhuang.hmcl.util.Pair;
Expand All @@ -46,33 +44,33 @@ public final class BMCLAPIDownloadProvider implements DownloadProvider {
private final String apiRoot;
private final GameVersionList game;
private final FabricVersionList fabric;
private final FabricAPIVersionList fabricApi;
private final ModrinthComponentVersionList fabricApi;
private final ForgeBMCLVersionList forge;
private final CleanroomVersionList cleanroom;
private final LegacyFabricVersionList legacyFabric;
private final LegacyFabricAPIVersionList legacyFabricApi;
private final ModrinthComponentVersionList legacyFabricApi;
private final NeoForgeBMCLVersionList neoforge;
private final LiteLoaderBMCLVersionList liteLoader;
private final OptiFineBMCLVersionList optifine;
private final QuiltVersionList quilt;
private final QuiltAPIVersionList quiltApi;
private final ModrinthComponentVersionList quiltApi;
private final List<Pair<String, String>> replacement;
private final List<Pair<String, String>> fallbackReplacement;

public BMCLAPIDownloadProvider(String apiRoot) {
this.apiRoot = apiRoot;
this.game = new GameVersionList(this);
this.fabric = new FabricVersionList(this);
this.fabricApi = new FabricAPIVersionList(this);
this.fabricApi = new ModrinthComponentVersionList(this, GameComponentType.FABRIC_API, "P7dR8mSH");
this.forge = new ForgeBMCLVersionList(apiRoot);
this.cleanroom = new CleanroomVersionList(this);
this.neoforge = new NeoForgeBMCLVersionList(apiRoot);
this.liteLoader = new LiteLoaderBMCLVersionList(this);
this.optifine = new OptiFineBMCLVersionList(apiRoot);
this.quilt = new QuiltVersionList(this);
this.quiltApi = new QuiltAPIVersionList(this);
this.quiltApi = new ModrinthComponentVersionList(this, GameComponentType.QUILT_API, "qvIfYCYJ");
this.legacyFabric = new LegacyFabricVersionList(this);
this.legacyFabricApi = new LegacyFabricAPIVersionList(this);
this.legacyFabricApi = new ModrinthComponentVersionList(this, GameComponentType.LEGACY_FABRIC_API, "9CJED7xi");

this.replacement = List.of(
pair("https://bmclapi2.bangbang93.com", apiRoot),
Expand Down
Loading