From c1396c05aa292e5d224a7dc45db9571253a63a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:01:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20Fabric=20/=20Quilt=20API?= =?UTF-8?q?=20=E5=AE=89=E8=A3=85=E6=8F=90=E7=A4=BA=20(#4792)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> Co-authored-by: Glavo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../hmcl/ui/download/AbstractInstallersPage.java | 14 +++++++++++--- .../src/main/resources/assets/lang/I18N.properties | 2 +- .../main/resources/assets/lang/I18N_ar.properties | 2 +- .../main/resources/assets/lang/I18N_es.properties | 2 +- .../main/resources/assets/lang/I18N_ja.properties | 2 +- .../main/resources/assets/lang/I18N_lzh.properties | 2 +- .../main/resources/assets/lang/I18N_ru.properties | 2 +- .../main/resources/assets/lang/I18N_uk.properties | 2 +- .../main/resources/assets/lang/I18N_zh.properties | 2 +- .../resources/assets/lang/I18N_zh_CN.properties | 2 +- 10 files changed, 20 insertions(+), 12 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AbstractInstallersPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AbstractInstallersPage.java index 88f9f9de4..4ae6406f4 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AbstractInstallersPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/AbstractInstallersPage.java @@ -24,12 +24,12 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.*; +import javafx.scene.layout.BorderPane; import javafx.scene.layout.FlowPane; import javafx.scene.layout.HBox; import org.jackhuang.hmcl.download.DownloadProvider; import org.jackhuang.hmcl.download.LibraryAnalyzer; import org.jackhuang.hmcl.ui.Controllers; -import javafx.scene.layout.BorderPane; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.InstallerItem; import org.jackhuang.hmcl.ui.construct.MessageDialogPane; @@ -38,9 +38,11 @@ import org.jackhuang.hmcl.ui.wizard.WizardController; import org.jackhuang.hmcl.ui.wizard.WizardPage; import org.jackhuang.hmcl.util.SettingsMap; +import static org.jackhuang.hmcl.setting.ConfigHolder.config; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; public abstract class AbstractInstallersPage extends Control implements WizardPage { + public static final String FABRIC_QUILT_API_TIP = "fabricQuiltApi"; protected final WizardController controller; protected InstallerItem.InstallerItemGroup group; @@ -56,8 +58,14 @@ public abstract class AbstractInstallersPage extends Control implements WizardPa String libraryId = library.getLibraryId(); if (libraryId.equals(LibraryAnalyzer.LibraryType.MINECRAFT.getPatchId())) continue; library.setOnInstall(() -> { - if (LibraryAnalyzer.LibraryType.FABRIC_API.getPatchId().equals(libraryId)) { - Controllers.dialog(i18n("install.installer.fabric-api.warning"), i18n("message.warning"), MessageDialogPane.MessageType.WARNING); + if (!Boolean.TRUE.equals(config().getShownTips().get(FABRIC_QUILT_API_TIP)) + && (LibraryAnalyzer.LibraryType.FABRIC_API.getPatchId().equals(libraryId) + || LibraryAnalyzer.LibraryType.QUILT_API.getPatchId().equals(libraryId))) { + Controllers.dialog(new MessageDialogPane.Builder( + i18n("install.installer.fabric-quilt-api.warning", i18n("install.installer." + libraryId)), + i18n("message.warning"), + MessageDialogPane.MessageType.WARNING + ).ok(null).addCancel(i18n("button.do_not_show_again"), () -> config().getShownTips().put(FABRIC_QUILT_API_TIP, true)).build()); } if (!(library.resolvedStateProperty().get() instanceof InstallerItem.IncompatibleState)) diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index 7b2439aa8..e34ee60f2 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -719,7 +719,7 @@ install.installer.depend=Requires %s install.installer.do_not_install=Do not install install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=Warning: Fabric API 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 Fabric API will not function. If you do want to change the directory, you should reinstall it. +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 install.installer.game=Minecraft diff --git a/HMCL/src/main/resources/assets/lang/I18N_ar.properties b/HMCL/src/main/resources/assets/lang/I18N_ar.properties index 003531804..eea438981 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ar.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ar.properties @@ -696,7 +696,7 @@ install.installer.depend=يتطلب %s install.installer.do_not_install=عدم التثبيت install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=تحذير: Fabric API هو تعديل وسيتم تثبيته في دليل التعديلات لنسخة اللعبة. يرجى عدم تغيير دليل عمل اللعبة، أو لن يعمل Fabric API. إذا كنت تريد تغيير الدليل، فيجب عليك إعادة تثبيته. +install.installer.fabric-quilt-api.warning=تحذير: %1$s هو تعديل وسيتم تثبيته في دليل التعديلات لنسخة اللعبة. يرجى عدم تغيير دليل عمل اللعبة، أو لن يعمل %1$s. إذا كنت تريد تغيير الدليل، فيجب عليك إعادة تثبيته. install.installer.forge=Forge install.installer.neoforge=NeoForge install.installer.game=Minecraft diff --git a/HMCL/src/main/resources/assets/lang/I18N_es.properties b/HMCL/src/main/resources/assets/lang/I18N_es.properties index b61310854..9b1ddca4c 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_es.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_es.properties @@ -701,7 +701,7 @@ install.installer.depend=Requiere %s install.installer.do_not_install=No instalar install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=Atención: Fabric API es un mod, y se instalará en el directorio de mods de la instancia del juego. Por favor, no cambies el directorio de trabajo del juego, o el Fabric API no funcionará. Si quieres cambiar esta configuración, debes reinstalarlo. +install.installer.fabric-quilt-api.warning=%1$s es un mod, y se instalará en el directorio de mods de la instancia del juego. Por favor, no cambies el directorio de trabajo del juego, o el %1$s no funcionará. Si quieres cambiar esta configuración, debes reinstalarlo. install.installer.forge=Forge install.installer.neoforge=NeoForge install.installer.game=Minecraft diff --git a/HMCL/src/main/resources/assets/lang/I18N_ja.properties b/HMCL/src/main/resources/assets/lang/I18N_ja.properties index 13a36e60d..187db5037 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ja.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ja.properties @@ -429,7 +429,7 @@ install.installer.choose=%s バージョンを選択してください install.installer.depend=%s に依存 install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=警告:Fabric APIはmodであり、新しいゲームのmodディレクトリにインストールされます。新しいゲームの実行ディレクトリを変更しないでください。変更すると、FabricAPIのインストールが失われます。その設定を変更したい場合は、FabricAPIを再インストールする必要があります。 +install.installer.fabric-quilt-api.warning=%1$sはmodであり、新しいゲームのmodディレクトリにインストールされます。新しいゲームの実行ディレクトリを変更しないでください。変更すると、%1$sのインストールが失われます。その設定を変更したい場合は、%1$sを再インストールする必要があります。 install.installer.forge=Forge install.installer.game=Minecraft install.installer.incompatible=%s と互換性がありません diff --git a/HMCL/src/main/resources/assets/lang/I18N_lzh.properties b/HMCL/src/main/resources/assets/lang/I18N_lzh.properties index 4208e23ec..0185a5a45 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_lzh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_lzh.properties @@ -498,7 +498,7 @@ install.installer.depend=請先裝 %s install.installer.do_not_install=不裝 install.installer.fabric=緞 install.installer.fabric-api=緞界 -install.installer.fabric-api.warning=誡:緞界者,改囊也,將措乎新戲之改囊案夾也。既裝而無改戲之「行徑」。將改,而須復置之。 +install.installer.fabric-quilt-api.warning=%1$s者,改囊也,將措乎新戲之改囊案夾也。既裝而無改戲之「行徑」。將改,而須復置之。 install.installer.forge=鍛 install.installer.neoforge=新鍛 install.installer.game=礦藝 diff --git a/HMCL/src/main/resources/assets/lang/I18N_ru.properties b/HMCL/src/main/resources/assets/lang/I18N_ru.properties index 6873232d7..60098a6ee 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_ru.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_ru.properties @@ -692,7 +692,7 @@ install.installer.depend=Требуется %s install.installer.do_not_install=Не устанавливать install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=Предупреждение: Fabric API является модом и будет установлен в папку mod в сборке игры. Пожалуйста, не меняйте рабочую папку сборки, иначе Fabric API не будет работать. Если вы все же хотите изменить папку, вам следует переустановить сборку. +install.installer.fabric-quilt-api.warning=%1$s является модом и будет установлен в папку mod в сборке игры. Пожалуйста, не меняйте рабочую папку сборки, иначе %1$s не будет работать. Если вы все же хотите изменить папку, вам следует переустановить сборку. install.installer.forge=Forge install.installer.neoforge=NeoForge install.installer.game=Minecraft diff --git a/HMCL/src/main/resources/assets/lang/I18N_uk.properties b/HMCL/src/main/resources/assets/lang/I18N_uk.properties index 30949bc44..978448e0c 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_uk.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_uk.properties @@ -640,7 +640,7 @@ install.installer.depend=Вимагає %s install.installer.do_not_install=Не встановлювати install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=Попередження: Fabric API - це мод, і він буде встановлений у каталог модів екземпляра гри. Не змінюйте робочий каталог гри, інакше Fabric API не працюватиме. Якщо ви все ж хочете змінити каталог, вам слід перевстановити його. +install.installer.fabric-quilt-api.warning=%1$s - це мод, і він буде встановлений у каталог модів екземпляра гри. Не змінюйте робочий каталог гри, інакше %1$s не працюватиме. Якщо ви все ж хочете змінити каталог, вам слід перевстановити його. install.installer.forge=Forge install.installer.neoforge=NeoForge install.installer.game=Minecraft diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 623bcb884..27be6ce69 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -518,7 +518,7 @@ install.installer.depend=需要先安裝 %s install.installer.do_not_install=不安裝 install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=警告:Fabric API 是一個模組,將會被安裝到新遊戲的模組目錄。請你在安裝遊戲後不要修改目前遊戲的「執行路徑」設定。如果你在之後修改了相關設定,則需要重新安裝 Fabric API。 +install.installer.fabric-quilt-api.warning=%1$s 是一個模組,將會被安裝到新遊戲的模組目錄。請你在安裝遊戲後不要修改目前遊戲的「執行路徑」設定。如果你在之後修改了相關設定,則需要重新安裝 %1$s。 install.installer.forge=Forge install.installer.neoforge=NeoForge install.installer.game=Minecraft diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index eac122af6..c3a5549d3 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -522,7 +522,7 @@ install.installer.depend=需要先安装 %s install.installer.do_not_install=不安装 install.installer.fabric=Fabric install.installer.fabric-api=Fabric API -install.installer.fabric-api.warning=警告:Fabric API 是一个模组,将会被安装到新游戏的模组文件夹。请你在安装游戏后不要修改当前游戏的“运行路径”设置。如果你在之后修改了相关设置,则需要重新安装 Fabric API。 +install.installer.fabric-quilt-api.warning=%1$s 是一个模组,将会被安装到新游戏的模组文件夹。请你在安装游戏后不要修改当前游戏的“版本隔离”设置。如果你在之后修改了相关设置,则需要重新安装 %1$s。 install.installer.forge=Forge install.installer.neoforge=NeoForge install.installer.game=Minecraft