From 466461522bb150d2481850bfdc67dde9a7e01162 Mon Sep 17 00:00:00 2001 From: Vasiliy Date: Tue, 28 May 2024 06:29:26 +0500 Subject: [PATCH 1/3] feat(loader): cli parameter to ignore unknown mods --- .../org/quiltmc/loader/impl/QuiltLoaderImpl.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java index cd3da5428..ad2706a1d 100644 --- a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java +++ b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java @@ -42,7 +42,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Map.Entry; import java.util.Optional; import java.util.Random; import java.util.Set; @@ -62,15 +61,14 @@ import org.quiltmc.loader.api.QuiltLoader; import org.quiltmc.loader.api.Version; import org.quiltmc.loader.api.entrypoint.EntrypointContainer; -import org.quiltmc.loader.api.gui.LoaderGuiClosed; import org.quiltmc.loader.api.gui.LoaderGuiException; import org.quiltmc.loader.api.gui.QuiltBasicWindow; import org.quiltmc.loader.api.gui.QuiltDisplayedError; +import org.quiltmc.loader.api.gui.QuiltDisplayedError.QuiltErrorButton; import org.quiltmc.loader.api.gui.QuiltGuiMessagesTab; import org.quiltmc.loader.api.gui.QuiltLoaderGui; import org.quiltmc.loader.api.gui.QuiltLoaderText; import org.quiltmc.loader.api.gui.QuiltWarningLevel; -import org.quiltmc.loader.api.gui.QuiltDisplayedError.QuiltErrorButton; import org.quiltmc.loader.api.plugin.ModContainerExt; import org.quiltmc.loader.api.plugin.ModMetadataExt; import org.quiltmc.loader.api.plugin.ModMetadataExt.ModEntrypoint; @@ -100,7 +98,6 @@ import org.quiltmc.loader.impl.metadata.qmj.ProvidedModMetadata; import org.quiltmc.loader.impl.patch.PatchLoader; import org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl; -import org.quiltmc.loader.impl.plugin.UnsupportedModChecker.UnsupportedType; import org.quiltmc.loader.impl.plugin.fabric.FabricModOption; import org.quiltmc.loader.impl.report.QuiltReport.CrashReportSaveFailed; import org.quiltmc.loader.impl.report.QuiltReportedError; @@ -122,9 +119,8 @@ import org.quiltmc.loader.impl.util.log.LogCategory; import org.spongepowered.asm.mixin.FabricUtil; -import net.fabricmc.loader.api.ObjectShare; - import net.fabricmc.api.EnvType; +import net.fabricmc.loader.api.ObjectShare; @QuiltLoaderInternal(value = QuiltLoaderInternalType.LEGACY_EXPOSED, replacements = QuiltLoader.class) public final class QuiltLoaderImpl { @@ -732,7 +728,9 @@ private boolean handleUnknownFiles(QuiltPluginManagerImpl plugins, ModSolveResul return false; } - { + /* skips the GUI window, logs the unknown mods table, continues launching minecraft */ + boolean ignoreUnknownMods = this.provider.getArguments().getExtraArgs().contains("--ignore-unknown-mods"); + if (!ignoreUnknownMods) { QuiltBasicWindow window = QuiltLoaderGui.createBasicWindow(); window.title(QuiltLoaderText.of("Quilt Loader " + QuiltLoaderImpl.VERSION)); window.addFolderViewButton(QuiltLoaderText.translate("button.open_mods_folder"), getModsDir()); @@ -790,7 +788,7 @@ private boolean handleUnknownFiles(QuiltPluginManagerImpl plugins, ModSolveResul Log.info(LogCategory.DISCOVERY, count + " unknown / unsupported mod files found:\n" + table); } - return true; + return !ignoreUnknownMods; } public String createModTable() { From 5dafa16aff58d0ee4ccab5aeadf796d9749a4e93 Mon Sep 17 00:00:00 2001 From: Vasiliy Date: Wed, 29 May 2024 16:22:27 +0500 Subject: [PATCH 2/3] revert(46646152): was not approved :) This reverts commit 466461522bb150d2481850bfdc67dde9a7e01162. --- .../org/quiltmc/loader/impl/QuiltLoaderImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java index ad2706a1d..cd3da5428 100644 --- a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java +++ b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java @@ -42,6 +42,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Map.Entry; import java.util.Optional; import java.util.Random; import java.util.Set; @@ -61,14 +62,15 @@ import org.quiltmc.loader.api.QuiltLoader; import org.quiltmc.loader.api.Version; import org.quiltmc.loader.api.entrypoint.EntrypointContainer; +import org.quiltmc.loader.api.gui.LoaderGuiClosed; import org.quiltmc.loader.api.gui.LoaderGuiException; import org.quiltmc.loader.api.gui.QuiltBasicWindow; import org.quiltmc.loader.api.gui.QuiltDisplayedError; -import org.quiltmc.loader.api.gui.QuiltDisplayedError.QuiltErrorButton; import org.quiltmc.loader.api.gui.QuiltGuiMessagesTab; import org.quiltmc.loader.api.gui.QuiltLoaderGui; import org.quiltmc.loader.api.gui.QuiltLoaderText; import org.quiltmc.loader.api.gui.QuiltWarningLevel; +import org.quiltmc.loader.api.gui.QuiltDisplayedError.QuiltErrorButton; import org.quiltmc.loader.api.plugin.ModContainerExt; import org.quiltmc.loader.api.plugin.ModMetadataExt; import org.quiltmc.loader.api.plugin.ModMetadataExt.ModEntrypoint; @@ -98,6 +100,7 @@ import org.quiltmc.loader.impl.metadata.qmj.ProvidedModMetadata; import org.quiltmc.loader.impl.patch.PatchLoader; import org.quiltmc.loader.impl.plugin.QuiltPluginManagerImpl; +import org.quiltmc.loader.impl.plugin.UnsupportedModChecker.UnsupportedType; import org.quiltmc.loader.impl.plugin.fabric.FabricModOption; import org.quiltmc.loader.impl.report.QuiltReport.CrashReportSaveFailed; import org.quiltmc.loader.impl.report.QuiltReportedError; @@ -119,9 +122,10 @@ import org.quiltmc.loader.impl.util.log.LogCategory; import org.spongepowered.asm.mixin.FabricUtil; -import net.fabricmc.api.EnvType; import net.fabricmc.loader.api.ObjectShare; +import net.fabricmc.api.EnvType; + @QuiltLoaderInternal(value = QuiltLoaderInternalType.LEGACY_EXPOSED, replacements = QuiltLoader.class) public final class QuiltLoaderImpl { public static final QuiltLoaderImpl INSTANCE = InitHelper.get(); @@ -728,9 +732,7 @@ private boolean handleUnknownFiles(QuiltPluginManagerImpl plugins, ModSolveResul return false; } - /* skips the GUI window, logs the unknown mods table, continues launching minecraft */ - boolean ignoreUnknownMods = this.provider.getArguments().getExtraArgs().contains("--ignore-unknown-mods"); - if (!ignoreUnknownMods) { + { QuiltBasicWindow window = QuiltLoaderGui.createBasicWindow(); window.title(QuiltLoaderText.of("Quilt Loader " + QuiltLoaderImpl.VERSION)); window.addFolderViewButton(QuiltLoaderText.translate("button.open_mods_folder"), getModsDir()); @@ -788,7 +790,7 @@ private boolean handleUnknownFiles(QuiltPluginManagerImpl plugins, ModSolveResul Log.info(LogCategory.DISCOVERY, count + " unknown / unsupported mod files found:\n" + table); } - return !ignoreUnknownMods; + return true; } public String createModTable() { From ecea31214c38c5d959e6942a768c2ea40493b13a Mon Sep 17 00:00:00 2001 From: Vasiliy Date: Wed, 29 May 2024 16:51:03 +0500 Subject: [PATCH 3/3] feat(loader): `-Dloader.ignore_unsupported_mods` property --- .../quiltmc/loader/impl/plugin/QuiltPluginManagerImpl.java | 5 +++++ .../java/org/quiltmc/loader/impl/util/SystemProperties.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/org/quiltmc/loader/impl/plugin/QuiltPluginManagerImpl.java b/src/main/java/org/quiltmc/loader/impl/plugin/QuiltPluginManagerImpl.java index 7184ea645..e50e8cf92 100644 --- a/src/main/java/org/quiltmc/loader/impl/plugin/QuiltPluginManagerImpl.java +++ b/src/main/java/org/quiltmc/loader/impl/plugin/QuiltPluginManagerImpl.java @@ -871,6 +871,11 @@ private void populateModsGuiTab(ModSolveResultImpl result) { } } + if (SystemProperties.getBoolean(SystemProperties.IGNORE_UNSUPPORTED_MODS, false)) { + /* skip unsupported mod checking */ + return; + } + Map> filesList = new HashMap<>(); for (PathLoadState loadState : modPaths.values()) { diff --git a/src/main/java/org/quiltmc/loader/impl/util/SystemProperties.java b/src/main/java/org/quiltmc/loader/impl/util/SystemProperties.java index 538430fc1..cbb4bd3ec 100644 --- a/src/main/java/org/quiltmc/loader/impl/util/SystemProperties.java +++ b/src/main/java/org/quiltmc/loader/impl/util/SystemProperties.java @@ -98,6 +98,8 @@ private SystemProperties() {} public static final String ALWAYS_DEFER_FILESYSTEM_OPERATIONS = "loader.workaround.defer_all_filesystem_operations"; public static final String DISABLE_QUILT_CLASS_PATH_CUSTOM_TABLE = "loader.quilt_class_path.disable_custom_table"; public static final String DISABLE_BUILTIN_MIXIN_EXTRAS = "loader.disable_builtin_mixin_extras"; + /** whether the loader should display unsupported mods with the GUI or ignore and continue starting up the game. */ + public static final String IGNORE_UNSUPPORTED_MODS = "loader.ignore_unsupported_mods"; /** Disables loader from registering its {@link URLStreamHandlerFactory} with * {@link URL#setURLStreamHandlerFactory(URLStreamHandlerFactory)}. This */