Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(loader): cli parameter to ignore unknown mods #434

Merged
merged 3 commits into from
May 29, 2024
Merged
Changes from 1 commit
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
14 changes: 6 additions & 8 deletions src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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<Void> window = QuiltLoaderGui.createBasicWindow();
window.title(QuiltLoaderText.of("Quilt Loader " + QuiltLoaderImpl.VERSION));
window.addFolderViewButton(QuiltLoaderText.translate("button.open_mods_folder"), getModsDir());
Expand Down Expand Up @@ -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() {
Expand Down
Loading