From 09ca822339c8e8c54ce324963ecc9b2bf0674a92 Mon Sep 17 00:00:00 2001 From: Daniel-Tayden Larsen <46882277+MCLegoMan@users.noreply.github.com> Date: Sat, 28 Oct 2023 02:22:18 +1300 Subject: [PATCH 1/5] Changed `Fabric Installer` to `Legacy Fabric Installer`, Changed `Fabric API` to `Legacy Fabric API`, Updated to 0.11.2, Removed "standalone server installer" notice from server tab as it linked to FabricMC. --- build.gradle | 16 +++++----- gradle.properties | 2 +- settings.gradle | 2 +- .../java/net/fabricmc/installer/Handler.java | 2 +- .../net/fabricmc/installer/InstallerGui.java | 2 +- .../java/net/fabricmc/installer/Main.java | 4 +-- .../fabricmc/installer/ServerLauncher.java | 15 +++++---- .../installer/client/ClientHandler.java | 2 +- .../installer/server/ServerHandler.java | 31 ------------------- .../installer/server/ServerInstaller.java | 6 ++-- .../fabricmc/installer/util/LauncherMeta.java | 2 +- src/main/resources/lang/installer.properties | 3 +- .../resources/lang/installer_ar_Ar.properties | 4 +-- .../resources/lang/installer_es_ES.properties | 2 +- .../resources/lang/installer_et_EE.properties | 3 +- .../resources/lang/installer_fi_FI.properties | 2 +- .../resources/lang/installer_fr_FR.properties | 2 +- .../resources/lang/installer_ja_JP.properties | 2 +- .../resources/lang/installer_pl_PL.properties | 2 +- .../resources/lang/installer_pt_BR.properties | 2 +- .../resources/lang/installer_ru_RU.properties | 2 +- .../resources/lang/installer_zh_CN.properties | 2 +- 22 files changed, 40 insertions(+), 70 deletions(-) diff --git a/build.gradle b/build.gradle index 67cbf84..33f7458 100644 --- a/build.gradle +++ b/build.gradle @@ -9,8 +9,8 @@ plugins { } sourceCompatibility = 1.8 -version = '0.11.1' -archivesBaseName = "fabric-installer" +version = '0.11.2' +archivesBaseName = "legacy-fabric-installer" def ENV = System.getenv() version = version + (ENV.GITHUB_ACTIONS ? "" : "+local") @@ -20,12 +20,12 @@ repositories { name = 'Fabric' url = 'https://maven.fabricmc.net/' } - mavenCentral() + mavenCentral() } def nativeLibVersion = "0.1.3" def nativeLibDistributions = [ - "windows-ARM64", "windows-Win32", "windows-x64", "macos-x86_64_arm64" + "windows-ARM64", "windows-Win32", "windows-x64", "macos-x86_64_arm64" ] dependencies { @@ -55,8 +55,8 @@ checkstyle { shadowJar { manifest { attributes 'Implementation-Title': 'LegacyFabricInstaller', - 'Implementation-Version': project.version, - 'Main-Class': 'net.fabricmc.installer.Main' + 'Implementation-Version': project.version, + 'Main-Class': 'net.fabricmc.installer.Main' } minimize() @@ -67,8 +67,8 @@ shadowJar { task serverJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) { manifest { attributes 'Implementation-Title': 'LegacyFabricInstaller', - 'Implementation-Version': project.version, - 'Main-Class': 'net.fabricmc.installer.ServerLauncher' + 'Implementation-Version': project.version, + 'Main-Class': 'net.fabricmc.installer.ServerLauncher' } minimize() diff --git a/gradle.properties b/gradle.properties index 9442107..927eb10 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -group = net.legacyfabric +group = net.legacyfabric \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 1b927d3..56de080 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,5 +9,5 @@ pluginManagement { } } -rootProject.name = 'fabric-installer' +rootProject.name = 'legacy-fabric-installer' diff --git a/src/main/java/net/fabricmc/installer/Handler.java b/src/main/java/net/fabricmc/installer/Handler.java index 2142719..b6b59ec 100644 --- a/src/main/java/net/fabricmc/installer/Handler.java +++ b/src/main/java/net/fabricmc/installer/Handler.java @@ -215,7 +215,7 @@ protected String buildEditorPaneStyle() { return String.format(Locale.ENGLISH, "font-family:%s;font-weight:%s;font-size:%dpt;background-color: rgb(%d,%d,%d);", font.getFamily(), (font.isBold() ? "bold" : "normal"), font.getSize(), color.getRed(), color.getGreen(), color.getBlue() - ); + ); } @Override diff --git a/src/main/java/net/fabricmc/installer/InstallerGui.java b/src/main/java/net/fabricmc/installer/InstallerGui.java index cd64359..5bae346 100644 --- a/src/main/java/net/fabricmc/installer/InstallerGui.java +++ b/src/main/java/net/fabricmc/installer/InstallerGui.java @@ -16,9 +16,9 @@ package net.fabricmc.installer; +import java.awt.Toolkit; import java.awt.Color; import java.awt.Dimension; -import java.awt.Toolkit; import java.io.File; import java.io.IOException; import java.util.Locale; diff --git a/src/main/java/net/fabricmc/installer/Main.java b/src/main/java/net/fabricmc/installer/Main.java index 286b626..77c8b27 100644 --- a/src/main/java/net/fabricmc/installer/Main.java +++ b/src/main/java/net/fabricmc/installer/Main.java @@ -41,7 +41,7 @@ public static void main(String[] args) throws IOException { System.setProperty("javax.net.ssl.trustStoreType", "WINDOWS-ROOT"); } - System.out.println("Loading LegacyFabric Installer: " + Main.class.getPackage().getImplementationVersion()); + System.out.println("Loading Fabric Installer: " + Main.class.getPackage().getImplementationVersion()); HANDLERS.add(new ClientHandler()); HANDLERS.add(new ServerHandler()); @@ -77,7 +77,7 @@ public static void main(String[] args) throws IOException { HANDLERS.forEach(handler -> System.out.printf("%s %s\n", handler.name().toLowerCase(), handler.cliHelp())); loadMetadata(); - System.out.printf("\nLatest Loader: %s\n", Main.LOADER_META.getLatestVersion(false).getVersion()); + System.out.printf("\nLatest Version: %s\nLatest Loader: %s\n", GAME_VERSION_META.getLatestVersion(argumentParser.has("snapshot")).getVersion(), Main.LOADER_META.getLatestVersion(false).getVersion()); } else { loadMetadata(); diff --git a/src/main/java/net/fabricmc/installer/ServerLauncher.java b/src/main/java/net/fabricmc/installer/ServerLauncher.java index 376bd4c..b52f439 100644 --- a/src/main/java/net/fabricmc/installer/ServerLauncher.java +++ b/src/main/java/net/fabricmc/installer/ServerLauncher.java @@ -91,11 +91,18 @@ private static LaunchData initialise() throws IOException { Path dataDir = baseDir.resolve(DATA_DIR); // Vanilla server jar - Path serverJar = dataDir.resolve(String.format("%s-server.jar", gameVersion)); + String customServerJar = System.getProperty("fabric.installer.server.gameJar", null); + Path serverJar = customServerJar == null ? dataDir.resolve(String.format("%s-server.jar", gameVersion)) : Paths.get(customServerJar); // Includes the mc version as this jar contains intermediary Path serverLaunchJar = dataDir.resolve(String.format("fabric-loader-server-%s-minecraft-%s.jar", loaderVersion.name, gameVersion)); - if (Files.exists(serverJar) && Files.exists(serverLaunchJar)) { // install exists, verify libs exist and determine main class + if (!Files.exists(serverJar)) { + InstallerProgress.CONSOLE.updateProgress(Utils.BUNDLE.getString("progress.download.minecraft")); + MinecraftServerDownloader downloader = new MinecraftServerDownloader(gameVersion); + downloader.downloadMinecraftServer(serverJar); + } + + if (Files.exists(serverLaunchJar)) { // install exists, verify libs exist and determine main class try { List classPath = new ArrayList<>(); String mainClass = readManifest(serverLaunchJar, classPath); @@ -123,10 +130,6 @@ private static LaunchData initialise() throws IOException { Files.createDirectories(dataDir); ServerInstaller.install(baseDir, loaderVersion, gameVersion, InstallerProgress.CONSOLE, serverLaunchJar); - InstallerProgress.CONSOLE.updateProgress(Utils.BUNDLE.getString("progress.download.minecraft")); - MinecraftServerDownloader downloader = new MinecraftServerDownloader(gameVersion); - downloader.downloadMinecraftServer(serverJar); - String mainClass = readManifest(serverLaunchJar, null); return new LaunchData(serverJar, serverLaunchJar, mainClass); diff --git a/src/main/java/net/fabricmc/installer/client/ClientHandler.java b/src/main/java/net/fabricmc/installer/client/ClientHandler.java index 94efe70..46d0d7b 100644 --- a/src/main/java/net/fabricmc/installer/client/ClientHandler.java +++ b/src/main/java/net/fabricmc/installer/client/ClientHandler.java @@ -148,7 +148,7 @@ private ProfileInstaller.LauncherType showLauncherTypeSelection() { null, options, options[0] - ); + ); if (result == JOptionPane.CLOSED_OPTION) { return null; diff --git a/src/main/java/net/fabricmc/installer/server/ServerHandler.java b/src/main/java/net/fabricmc/installer/server/ServerHandler.java index b24c836..9c4f64a 100644 --- a/src/main/java/net/fabricmc/installer/server/ServerHandler.java +++ b/src/main/java/net/fabricmc/installer/server/ServerHandler.java @@ -16,21 +16,13 @@ package net.fabricmc.installer.server; -import java.awt.Cursor; -import java.awt.Desktop; import java.awt.GridBagConstraints; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.text.MessageFormat; -import javax.swing.JLabel; import javax.swing.JPanel; import net.fabricmc.installer.Handler; @@ -38,7 +30,6 @@ import net.fabricmc.installer.LoaderVersion; import net.fabricmc.installer.util.ArgumentParser; import net.fabricmc.installer.util.InstallerProgress; -import net.fabricmc.installer.util.Reference; import net.fabricmc.installer.util.Utils; public class ServerHandler extends Handler { @@ -93,28 +84,6 @@ public String cliHelp() { return "-dir -mcversion -loader -downloadMinecraft"; } - @Override - public void setupPane1(JPanel pane, GridBagConstraints c, InstallerGui installerGui) { - if (!Desktop.isDesktopSupported() || !Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { - return; - } - - JLabel label = new JLabel(String.format("%s", Utils.BUNDLE.getString("prompt.server.launcher"))); - label.setCursor(new Cursor(Cursor.HAND_CURSOR)); - label.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - try { - Desktop.getDesktop().browse(new URI(Reference.SERVER_LAUNCHER_URL)); - } catch (IOException | URISyntaxException ex) { - ex.printStackTrace(); - } - } - }); - - addRow(pane, c, null, label); - } - @Override public void setupPane2(JPanel pane, GridBagConstraints c, InstallerGui installerGui) { installLocation.setText(Paths.get(".").toAbsolutePath().normalize().toString()); diff --git a/src/main/java/net/fabricmc/installer/server/ServerInstaller.java b/src/main/java/net/fabricmc/installer/server/ServerInstaller.java index b91fc00..031d4ba 100644 --- a/src/main/java/net/fabricmc/installer/server/ServerInstaller.java +++ b/src/main/java/net/fabricmc/installer/server/ServerInstaller.java @@ -88,8 +88,8 @@ public static void install(Path dir, LoaderVersion loaderVersion, String gameVer mainClassMeta = json.at("mainClass").asString(); } else { // loader jar available, generate library list from it - libraries.add(new Library(String.format("net.fabricmc:fabric-loader:%s", loaderVersion.name), "https://maven.fabricmc.net/", loaderVersion.path)); - libraries.add(new Library(String.format("net.fabricmc:intermediary:%s", gameVersion), "https://maven.legacyfabric.net/", null)); + libraries.add(new Library(String.format("net.fabricmc:fabric-loader:%s", loaderVersion.name), null, loaderVersion.path)); + libraries.add(new Library(String.format("net.fabricmc:intermediary:%s", gameVersion), "https://maven.fabricmc.net/", null)); try (ZipFile zf = new ZipFile(loaderVersion.path.toFile())) { ZipEntry entry = zf.getEntry("fabric-installer.json"); @@ -139,7 +139,7 @@ public static void install(Path dir, LoaderVersion loaderVersion, String gameVer } private static void makeLaunchJar(Path file, String launchMainClass, String jarMainClass, List libraryFiles, - boolean shadeLibraries, InstallerProgress progress) throws IOException { + boolean shadeLibraries, InstallerProgress progress) throws IOException { Files.deleteIfExists(file); try (ZipOutputStream zipOutputStream = new ZipOutputStream(Files.newOutputStream(file))) { diff --git a/src/main/java/net/fabricmc/installer/util/LauncherMeta.java b/src/main/java/net/fabricmc/installer/util/LauncherMeta.java index 3f864cc..4b99081 100644 --- a/src/main/java/net/fabricmc/installer/util/LauncherMeta.java +++ b/src/main/java/net/fabricmc/installer/util/LauncherMeta.java @@ -37,7 +37,7 @@ public static LauncherMeta getLauncherMeta() throws IOException { private static LauncherMeta load() throws IOException { List versions = new ArrayList<>(); versions.addAll(getVersionsFromUrl(Reference.MINECRAFT_LAUNCHER_MANIFEST)); - versions.addAll(getVersionsFromUrl(Reference.OLD_SNAPSHOTS)); + versions.addAll(getVersionsFromUrl(Reference.OLD_SNAPSHOTS_MANIFEST)); return new LauncherMeta(versions); } diff --git a/src/main/resources/lang/installer.properties b/src/main/resources/lang/installer.properties index 45519de..2f4519c 100644 --- a/src/main/resources/lang/installer.properties +++ b/src/main/resources/lang/installer.properties @@ -37,8 +37,7 @@ prompt.server.jar.invalid=No valid {0} server jar found prompt.server.downloading=Downloading {0}/{1} MB prompt.server.generate=Generate prompt.server.overwrite=Are you sure you want to override the existing launch scripts? -prompt.server.launcher=Click here to use the standalone server launcher for an easier setup prompt.install.successful.title=Successfully Installed -prompt.install.successful=Fabric Loader {0} for {1} has been successfully installed.
Many mods also require you to put Fabric API into the mods folder. +prompt.install.successful=Fabric Loader {0} for {1} has been successfully installed.
Many mods also require you to put Legacy Fabric API into the mods folder. tab.client=Client tab.server=Server diff --git a/src/main/resources/lang/installer_ar_Ar.properties b/src/main/resources/lang/installer_ar_Ar.properties index 7ea4843..b9ac020 100644 --- a/src/main/resources/lang/installer_ar_Ar.properties +++ b/src/main/resources/lang/installer_ar_Ar.properties @@ -23,7 +23,7 @@ prompt.launcher.open.body=ماينكرافت لونشر يستعمل حاليا prompt.launcher.open.tile=ماينكرافت لونشر يستعمل حاليا prompt.game.version=:نسخة اللعبة prompt.ready.install=جاهز للتثبيث -prompt.select.location=حدد مكان التثبيث +prompt.select.location=:حدد مكان التثبيث prompt.server.info.jar=الملف الرسمي للخادم الرسمي إجباري prompt.server.info.command=إستعمل هذه التعليمة لتشغيل الخادم prompt.server.info.scipt=أو انتج سكريبت التشغيل @@ -33,6 +33,6 @@ prompt.server.jar.invalid={0} لم يتم العثور على ملف الخاد prompt.server.generate=إنشاء prompt.server.overwrite=هل أنت متأكد من أنك تريد تجاهل سكريبت التشغيل الحالية؟ prompt.install.successful.title=تم التثبيث بنجاح -prompt.install.successful=محمل فابريك {0} ل {1} تم تثبيثه بنجاح
الكثير من المودات تجبر وضع Fabric API في مجلد المودات. +prompt.install.successful=محمل فابريك {0} ل {1} تم تثبيثه بنجاح
الكثير من المودات تجبر وضع Legacy Fabric API في مجلد المودات. tab.client=العميل tab.server=الخادم diff --git a/src/main/resources/lang/installer_es_ES.properties b/src/main/resources/lang/installer_es_ES.properties index da1dca8..d9b371c 100644 --- a/src/main/resources/lang/installer_es_ES.properties +++ b/src/main/resources/lang/installer_es_ES.properties @@ -33,6 +33,6 @@ prompt.server.jar.invalid=No se encontró un JAR del servidor de la {0} válido prompt.server.generate=Generar prompt.server.overwrite=¿Estás seguro que quieres sobreescribir los scripts de lanzamiento existentes? prompt.install.successful.title=Instalado Correctamente -prompt.install.successful=Fabric Loader {0} para {1} ha sido instalado correctamente.
Muchos mods también necesitan que descargues Fabric API en tu carpeta de mods. +prompt.install.successful=Fabric Loader {0} para {1} ha sido instalado correctamente.
Muchos mods también necesitan que descargues Legacy Fabric API en tu carpeta de mods. tab.client=Cliente tab.server=Servidor diff --git a/src/main/resources/lang/installer_et_EE.properties b/src/main/resources/lang/installer_et_EE.properties index af2e255..d5edfbe 100644 --- a/src/main/resources/lang/installer_et_EE.properties +++ b/src/main/resources/lang/installer_et_EE.properties @@ -37,8 +37,7 @@ prompt.server.jar.invalid=Sobivat {0} serveri JARi ei leitud prompt.server.downloading=Allalaadimine {0}/{1} MB prompt.server.generate=Genereeri prompt.server.overwrite=Kas soovid kindlasti olemasolevad käivitusskriptid üle kirjutada? -prompt.server.launcher=Klõpsa siia, et kasutada lihtsamaks seadistuseks eraldiseisvat serverikäivitajat prompt.install.successful.title=Edukalt paigaldatud -prompt.install.successful=Fabric Loader {0} versioonile {1} on edukalt paigaldatud.
Mitmed modid eeldavad ka Fabric API asetamist mods kausta. +prompt.install.successful=Fabric Loader {0} versioonile {1} on edukalt paigaldatud.
Mitmed modid eeldavad ka Legacy Fabric API asetamist mods kausta. tab.client=Klient tab.server=Server diff --git a/src/main/resources/lang/installer_fi_FI.properties b/src/main/resources/lang/installer_fi_FI.properties index e2d6653..b6ef768 100644 --- a/src/main/resources/lang/installer_fi_FI.properties +++ b/src/main/resources/lang/installer_fi_FI.properties @@ -34,6 +34,6 @@ prompt.server.downloading=Ladataan {0}/{1} Mt prompt.server.generate=Generoi prompt.server.overwrite=Haluatko varmasti korvata olemassaolevat käynnistinskriptit? prompt.install.successful.title=Asennus onnistui -prompt.install.successful=Fabric Loader {0} versiolle {1} asennettiin onnistuneesti.
Monet modit vaativat myös Fabric API:n lataamisen mods-kansioon. +prompt.install.successful=Fabric Loader {0} versiolle {1} asennettiin onnistuneesti.
Monet modit vaativat myös Legacy Fabric API:n lataamisen mods-kansioon. tab.client=Asiakasohjelma tab.server=Palvelin diff --git a/src/main/resources/lang/installer_fr_FR.properties b/src/main/resources/lang/installer_fr_FR.properties index 8c5eb4d..e3d12e5 100644 --- a/src/main/resources/lang/installer_fr_FR.properties +++ b/src/main/resources/lang/installer_fr_FR.properties @@ -31,6 +31,6 @@ prompt.server.jar.invalid=Aucun fichier jar serveur {0} valide trouvé prompt.server.generate=Générer prompt.server.overwrite=Voulez-vous vraiment remplacer les scripts de lancement existants? prompt.install.successful.title=Installé avec succès -prompt.install.successful=Fabric Loader {0} pour la version {1} a été installé avec succès.
De nombreux mods vous demanderons également de placer Fabric API dans le dossier mods. +prompt.install.successful=Fabric Loader {0} pour la version {1} a été installé avec succès.
De nombreux mods vous demanderons également de placer Legacy Fabric API dans le dossier mods. tab.client=Client tab.server=Serveur diff --git a/src/main/resources/lang/installer_ja_JP.properties b/src/main/resources/lang/installer_ja_JP.properties index a8ff7a0..b7f50f8 100644 --- a/src/main/resources/lang/installer_ja_JP.properties +++ b/src/main/resources/lang/installer_ja_JP.properties @@ -37,6 +37,6 @@ prompt.server.jar.invalid=無効な {0} サーバー JAR が見つかりまし prompt.server.generate=生成 prompt.server.overwrite=既存の起動スクリプトを上書きしてもよろしいですか? prompt.install.successful.title=正常にインストールされました -prompt.install.successful={1}用のFabric ローダー {0} が正常にインストールされました。
多くのmodを使用する場合には、Fabric API をmodsフォルダーに入れる必要があります。 +prompt.install.successful={1}用のFabric ローダー {0} が正常にインストールされました。
多くのmodを使用する場合には、Legacy Fabric API をmodsフォルダーに入れる必要があります。 tab.client=クライアント tab.server=サーバー diff --git a/src/main/resources/lang/installer_pl_PL.properties b/src/main/resources/lang/installer_pl_PL.properties index c74966a..4f5ba49 100644 --- a/src/main/resources/lang/installer_pl_PL.properties +++ b/src/main/resources/lang/installer_pl_PL.properties @@ -31,6 +31,6 @@ prompt.server.jar.invalid=Poprawny plik jar serwera {0} nie został znaleziony prompt.server.generate=Generuj prompt.server.overwrite=Czy na pewno chcesz nadpisać istniejące skrypty uruchamiające? prompt.install.successful.title=Pomyślnie zainstalowano -prompt.install.successful=Loader Fabric {0} dla {1} został pomyślnie zainstalowany.
Wiele modów wymaga także umieszczenia Fabric API w folderze modów. +prompt.install.successful=Loader Fabric {0} dla {1} został pomyślnie zainstalowany.
Wiele modów wymaga także umieszczenia Legacy Fabric API w folderze modów. tab.client=Klient tab.server=Serwer \ No newline at end of file diff --git a/src/main/resources/lang/installer_pt_BR.properties b/src/main/resources/lang/installer_pt_BR.properties index 057630f..2bb2f84 100644 --- a/src/main/resources/lang/installer_pt_BR.properties +++ b/src/main/resources/lang/installer_pt_BR.properties @@ -38,6 +38,6 @@ prompt.server.downloading=Baixando {0}/{1} MB prompt.server.generate=Gerar prompt.server.overwrite=Deseja mesmo sobrescrever os scripts de inicialização atuais? prompt.install.successful.title=Instalação com êxito -prompt.install.successful=O Fabric Loader {0} para {1} foi instalado com êxito.
Muitos mods exigem o Fabric API na pasta de mods. +prompt.install.successful=O Fabric Loader {0} para {1} foi instalado com êxito.
Muitos mods exigem o Legacy Fabric API na pasta de mods. tab.client=Cliente tab.server=Servidor diff --git a/src/main/resources/lang/installer_ru_RU.properties b/src/main/resources/lang/installer_ru_RU.properties index 0301cf4..ab70dd7 100644 --- a/src/main/resources/lang/installer_ru_RU.properties +++ b/src/main/resources/lang/installer_ru_RU.properties @@ -31,6 +31,6 @@ prompt.server.jar.invalid=Действительный {0} jar сервера н prompt.server.generate=Сгенерировать prompt.server.overwrite=Вы уверены, что хотите переопределить существующий скрипт запуска? prompt.install.successful.title=Успешно установлено -prompt.install.successful=Загрузчик Fabric {0} для {1} был успешно установлен.
Многие моды также требуют, чтобы вы положили Fabric API в папку модов. +prompt.install.successful=Загрузчик Fabric {0} для {1} был успешно установлен.
Многие моды также требуют, чтобы вы положили Legacy Fabric API в папку модов. tab.client=Клиент tab.server=Сервер diff --git a/src/main/resources/lang/installer_zh_CN.properties b/src/main/resources/lang/installer_zh_CN.properties index 5f4cc8c..c64377f 100644 --- a/src/main/resources/lang/installer_zh_CN.properties +++ b/src/main/resources/lang/installer_zh_CN.properties @@ -31,6 +31,6 @@ prompt.server.jar.invalid=找不到有效的 {0} 服务端 prompt.server.generate=生成 prompt.server.overwrite=您确定要覆盖现有的启动脚本吗? prompt.install.successful.title=安装成功 -prompt.install.successful={1}的Fabric加载器{0}已成功安装。
许多MOD还要求您将Fabric API放入mods文件夹。 +prompt.install.successful={1}的Fabric加载器{0}已成功安装。
许多MOD还要求您将Legacy Fabric API放入mods文件夹。 tab.client=客户端 tab.server=服务端 From 2baa3d0a0add7a9c249f426bbd026cbf77649726 Mon Sep 17 00:00:00 2001 From: Daniel-Tayden Larsen <46882277+MCLegoMan@users.noreply.github.com> Date: Sat, 28 Oct 2023 02:26:13 +1300 Subject: [PATCH 2/5] Updated `Fabric API` to `Legacy Fabric API` --- src/main/resources/lang/installer_ar_AR.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/lang/installer_ar_AR.properties b/src/main/resources/lang/installer_ar_AR.properties index 4d79c0b..b9ac020 100644 --- a/src/main/resources/lang/installer_ar_AR.properties +++ b/src/main/resources/lang/installer_ar_AR.properties @@ -33,6 +33,6 @@ prompt.server.jar.invalid={0} لم يتم العثور على ملف الخاد prompt.server.generate=إنشاء prompt.server.overwrite=هل أنت متأكد من أنك تريد تجاهل سكريبت التشغيل الحالية؟ prompt.install.successful.title=تم التثبيث بنجاح -prompt.install.successful=محمل فابريك {0} ل {1} تم تثبيثه بنجاح
الكثير من المودات تجبر وضع Fabric API في مجلد المودات. +prompt.install.successful=محمل فابريك {0} ل {1} تم تثبيثه بنجاح
الكثير من المودات تجبر وضع Legacy Fabric API في مجلد المودات. tab.client=العميل tab.server=الخادم From b42510c3df468a9de7bdfc95fcb99c9f336a8e25 Mon Sep 17 00:00:00 2001 From: Daniel-Tayden Larsen <46882277+MCLegoMan@users.noreply.github.com> Date: Sat, 28 Oct 2023 02:38:13 +1300 Subject: [PATCH 3/5] As the standalone server notice is no longer used, the URL is no longer required. Additionally fixed the old snapshots manifest that was missing in a previous commit. --- src/main/java/net/fabricmc/installer/util/Reference.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/net/fabricmc/installer/util/Reference.java b/src/main/java/net/fabricmc/installer/util/Reference.java index c9cf34d..68c1937 100644 --- a/src/main/java/net/fabricmc/installer/util/Reference.java +++ b/src/main/java/net/fabricmc/installer/util/Reference.java @@ -20,9 +20,8 @@ public class Reference { public static final String LOADER_NAME = "fabric-loader"; public static final String FABRIC_API_URL = "https://github.com/Legacy-Fabric/fabric/releases/"; - public static final String SERVER_LAUNCHER_URL = "https://fabricmc.net/use/server/"; public static final String MINECRAFT_LAUNCHER_MANIFEST = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"; - public static final String OLD_SNAPSHOTS = "https://raw.githubusercontent.com/Legacy-Fabric/manifests/master/manifest.json"; + public static final String OLD_SNAPSHOTS_MANIFEST = "https://raw.githubusercontent.com/Legacy-Fabric/manifests/master/manifest.json"; static final String DEFAULT_META_SERVER = "https://meta.legacyfabric.net/"; static final String DEFAULT_MAVEN_SERVER = "https://maven.legacyfabric.net/"; From f57c5991375774ae4b82c645113dc057cfef5337 Mon Sep 17 00:00:00 2001 From: Daniel-Tayden Larsen <46882277+MCLegoMan@users.noreply.github.com> Date: Sat, 28 Oct 2023 04:53:21 +1300 Subject: [PATCH 4/5] Reverted some overlooked changes. --- src/main/java/net/fabricmc/installer/Main.java | 4 ++-- .../java/net/fabricmc/installer/ServerLauncher.java | 2 +- .../net/fabricmc/installer/client/ClientHandler.java | 2 +- .../fabricmc/installer/server/ServerInstaller.java | 5 +++-- .../java/net/fabricmc/installer/util/Reference.java | 11 +++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/net/fabricmc/installer/Main.java b/src/main/java/net/fabricmc/installer/Main.java index 77c8b27..0e7a5bd 100644 --- a/src/main/java/net/fabricmc/installer/Main.java +++ b/src/main/java/net/fabricmc/installer/Main.java @@ -41,7 +41,7 @@ public static void main(String[] args) throws IOException { System.setProperty("javax.net.ssl.trustStoreType", "WINDOWS-ROOT"); } - System.out.println("Loading Fabric Installer: " + Main.class.getPackage().getImplementationVersion()); + System.out.println("Loading Legacy Fabric Installer: " + Main.class.getPackage().getImplementationVersion()); HANDLERS.add(new ClientHandler()); HANDLERS.add(new ServerHandler()); @@ -77,7 +77,7 @@ public static void main(String[] args) throws IOException { HANDLERS.forEach(handler -> System.out.printf("%s %s\n", handler.name().toLowerCase(), handler.cliHelp())); loadMetadata(); - System.out.printf("\nLatest Version: %s\nLatest Loader: %s\n", GAME_VERSION_META.getLatestVersion(argumentParser.has("snapshot")).getVersion(), Main.LOADER_META.getLatestVersion(false).getVersion()); + System.out.printf("\nLatest Loader: %s\n", Main.LOADER_META.getLatestVersion(false).getVersion()); } else { loadMetadata(); diff --git a/src/main/java/net/fabricmc/installer/ServerLauncher.java b/src/main/java/net/fabricmc/installer/ServerLauncher.java index b52f439..58bb3cb 100644 --- a/src/main/java/net/fabricmc/installer/ServerLauncher.java +++ b/src/main/java/net/fabricmc/installer/ServerLauncher.java @@ -53,7 +53,7 @@ public static void main(String[] args) throws Throwable { try { launchData = initialise(); } catch (IOException e) { - throw new RuntimeException("Failed to setup fabric server", e); + throw new RuntimeException("Failed to setup legacy fabric server", e); } Objects.requireNonNull(launchData, "launchData is null, cannot proceed"); diff --git a/src/main/java/net/fabricmc/installer/client/ClientHandler.java b/src/main/java/net/fabricmc/installer/client/ClientHandler.java index 46d0d7b..a53d52c 100644 --- a/src/main/java/net/fabricmc/installer/client/ClientHandler.java +++ b/src/main/java/net/fabricmc/installer/client/ClientHandler.java @@ -117,7 +117,7 @@ private void doInstall() { } private void showInstalledMessage(String loaderVersion, String gameVersion) { - JEditorPane pane = new JEditorPane("text/html", "" + new MessageFormat(Utils.BUNDLE.getString("prompt.install.successful")).format(new Object[]{loaderVersion, gameVersion, Reference.FABRIC_API_URL}) + ""); + JEditorPane pane = new JEditorPane("text/html", "" + new MessageFormat(Utils.BUNDLE.getString("prompt.install.successful")).format(new Object[]{loaderVersion, gameVersion, Reference.LEGACY_FABRIC_API_URL}) + ""); pane.setEditable(false); pane.addHyperlinkListener(e -> { diff --git a/src/main/java/net/fabricmc/installer/server/ServerInstaller.java b/src/main/java/net/fabricmc/installer/server/ServerInstaller.java index 031d4ba..95a4b94 100644 --- a/src/main/java/net/fabricmc/installer/server/ServerInstaller.java +++ b/src/main/java/net/fabricmc/installer/server/ServerInstaller.java @@ -53,6 +53,7 @@ import net.fabricmc.installer.util.FabricService; import net.fabricmc.installer.util.InstallerProgress; import net.fabricmc.installer.util.Library; +import net.fabricmc.installer.util.Reference; import net.fabricmc.installer.util.Utils; public class ServerInstaller { @@ -88,8 +89,8 @@ public static void install(Path dir, LoaderVersion loaderVersion, String gameVer mainClassMeta = json.at("mainClass").asString(); } else { // loader jar available, generate library list from it - libraries.add(new Library(String.format("net.fabricmc:fabric-loader:%s", loaderVersion.name), null, loaderVersion.path)); - libraries.add(new Library(String.format("net.fabricmc:intermediary:%s", gameVersion), "https://maven.fabricmc.net/", null)); + libraries.add(new Library(String.format("net.fabricmc:fabric-loader:%s", loaderVersion.name), Reference.FABRIC_MAVEN, loaderVersion.path)); + libraries.add(new Library(String.format("net.fabricmc:intermediary:%s", gameVersion), Reference.LEGACY_FABRIC_MAVEN, null)); try (ZipFile zf = new ZipFile(loaderVersion.path.toFile())) { ZipEntry entry = zf.getEntry("fabric-installer.json"); diff --git a/src/main/java/net/fabricmc/installer/util/Reference.java b/src/main/java/net/fabricmc/installer/util/Reference.java index 68c1937..fcc2129 100644 --- a/src/main/java/net/fabricmc/installer/util/Reference.java +++ b/src/main/java/net/fabricmc/installer/util/Reference.java @@ -18,16 +18,15 @@ public class Reference { public static final String LOADER_NAME = "fabric-loader"; - - public static final String FABRIC_API_URL = "https://github.com/Legacy-Fabric/fabric/releases/"; + public static final String LEGACY_FABRIC_API_URL = "https://github.com/Legacy-Fabric/fabric/releases/"; public static final String MINECRAFT_LAUNCHER_MANIFEST = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"; public static final String OLD_SNAPSHOTS_MANIFEST = "https://raw.githubusercontent.com/Legacy-Fabric/manifests/master/manifest.json"; - - static final String DEFAULT_META_SERVER = "https://meta.legacyfabric.net/"; - static final String DEFAULT_MAVEN_SERVER = "https://maven.legacyfabric.net/"; + public static final String LEGACY_FABRIC_META = "https://meta.legacyfabric.net/"; + public static final String FABRIC_MAVEN = "https://maven.fabricmc.net/"; + public static final String LEGACY_FABRIC_MAVEN = "https://maven.legacyfabric.net/"; static final FabricService[] FABRIC_SERVICES = { - new FabricService(DEFAULT_META_SERVER, DEFAULT_MAVEN_SERVER)//, + new FabricService(LEGACY_FABRIC_META, LEGACY_FABRIC_MAVEN)//, // Do not use these fallback servers to interact with our web services. They can and will be unavailable at times and only support limited throughput. // new FabricService("https://meta2.fabricmc.net/", "https://maven2.fabricmc.net/"), // new FabricService("https://meta3.fabricmc.net/", "https://maven3.fabricmc.net/") From 790e4eee0d5fd4a823d76745cc0195f35215ff41 Mon Sep 17 00:00:00 2001 From: Daniel-Tayden Larsen <46882277+MCLegoMan@users.noreply.github.com> Date: Sat, 28 Oct 2023 05:09:59 +1300 Subject: [PATCH 5/5] Uh oop, didn't commit this. --- .../net/fabricmc/installer/util/FabricService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/fabricmc/installer/util/FabricService.java b/src/main/java/net/fabricmc/installer/util/FabricService.java index e47c914..81986b4 100644 --- a/src/main/java/net/fabricmc/installer/util/FabricService.java +++ b/src/main/java/net/fabricmc/installer/util/FabricService.java @@ -40,11 +40,11 @@ public static Json queryMetaJson(String path) throws IOException { * Query and decode JSON from url, substituting Fabric Maven with fallbacks or overrides. */ public static Json queryJsonSubstitutedMaven(String url) throws IOException { - if (!url.startsWith(Reference.DEFAULT_MAVEN_SERVER)) { + if (!url.startsWith(Reference.LEGACY_FABRIC_MAVEN)) { return Json.read(Utils.readString(new URL(url))); } - String path = url.substring(Reference.DEFAULT_MAVEN_SERVER.length()); + String path = url.substring(Reference.LEGACY_FABRIC_MAVEN.length()); return invokeWithFallbacks((service, arg) -> Json.read(Utils.readString(new URL(service.maven + arg))), path); } @@ -53,12 +53,12 @@ public static Json queryJsonSubstitutedMaven(String url) throws IOException { * Download url to file, substituting Fabric Maven with fallbacks or overrides. */ public static void downloadSubstitutedMaven(String url, Path out) throws IOException { - if (!url.startsWith(Reference.DEFAULT_MAVEN_SERVER)) { + if (!url.startsWith(Reference.LEGACY_FABRIC_MAVEN)) { Utils.downloadFile(new URL(url), out); return; } - String path = url.substring(Reference.DEFAULT_MAVEN_SERVER.length()); + String path = url.substring(Reference.LEGACY_FABRIC_MAVEN.length()); invokeWithFallbacks((service, arg) -> { Utils.downloadFile(new URL(service.maven + arg), out); @@ -106,8 +106,8 @@ private interface Handler { public static void setFixed(String metaUrl, String mavenUrl) { if (metaUrl == null && mavenUrl == null) throw new NullPointerException("both meta and maven are null"); - if (metaUrl == null) metaUrl = Reference.DEFAULT_META_SERVER; - if (mavenUrl == null) mavenUrl = Reference.DEFAULT_MAVEN_SERVER; + if (metaUrl == null) metaUrl = Reference.LEGACY_FABRIC_META; + if (mavenUrl == null) mavenUrl = Reference.LEGACY_FABRIC_MAVEN; activeIndex = -1; fixedService = new FabricService(metaUrl, mavenUrl);