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
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ dependencies {
include "net.fabricmc:tiny-remapper:0.13.0"
include "net.fabricmc:class-tweaker:0.3.0-beta.2"
include "net.fabricmc:mapping-io:0.7.1"
include "com.formdev:flatlaf:3.7.1:no-natives"
Comment thread
SmushyTaco marked this conversation as resolved.

development "io.github.llamalad7:mixinextras-fabric:$mixin_extras_version"

Expand Down Expand Up @@ -206,6 +207,7 @@ tasks.register('fatJar', ShadowJar) {
relocate 'net.fabricmc.classtweaker', 'net.fabricmc.loader.impl.lib.classtweaker'
relocate 'net.fabricmc.tinyremapper', 'net.fabricmc.loader.impl.lib.tinyremapper'
relocate 'net.fabricmc.mappingio', 'net.fabricmc.loader.impl.lib.mappingio'
relocate 'com.formdev.flatlaf', 'net.fabricmc.loader.impl.lib.flatlaf'

exclude 'about.html'
exclude 'sat4j.version'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/fabricmc/loader/impl/FabricLoaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void load() {
setup();
} catch (ModResolutionException exception) {
if (exception.getCause() == null) {
throw FormattedException.ofLocalized("exception.incompatible", exception.getMessage());
throw FormattedException.ofLocalized("exception.incompatible", exception.getMessage(), exception);
} else {
throw FormattedException.ofLocalized("exception.incompatible", exception);
}
Expand Down Expand Up @@ -469,7 +469,7 @@ public boolean isDevelopmentEnvironment() {
return FabricLauncherBase.getLauncher().isDevelopment();
}

private void addMod(ModCandidateImpl candidate) throws ModResolutionException {
private void addMod(ModCandidateImpl candidate) {
ModContainerImpl container = new ModContainerImpl(candidate);
mods.add(container);
modMap.put(candidate.getId(), container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,32 @@

package net.fabricmc.loader.impl.discovery;

import net.fabricmc.loader.impl.gui.FabricStatusTree.DependencyGuiData;

@SuppressWarnings("serial")
public class ModResolutionException extends Exception {
private final DependencyGuiData dependencyGuiData;
public ModResolutionException(String s) {
super(s);
this.dependencyGuiData = null;
}

public ModResolutionException(String format, Object... args) {
super(String.format(format, args));
this.dependencyGuiData = null;
}

public ModResolutionException(String format, DependencyGuiData dependencyGuiData, Object... args) {
super(String.format(format, args));
this.dependencyGuiData = dependencyGuiData;
}

public ModResolutionException(String s, Throwable t) {
super(s, t);
this.dependencyGuiData = null;
}

public DependencyGuiData getDependencyGuiData() {
return dependencyGuiData;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.fabricmc.loader.impl.metadata.ModDependencyImpl;
import net.fabricmc.loader.impl.util.log.Log;
import net.fabricmc.loader.impl.util.log.LogCategory;
import net.fabricmc.loader.impl.gui.FabricStatusTree.DependencyGuiData;

public class ModResolver {
public static List<ModCandidateImpl> resolve(Collection<ModCandidateImpl> candidates, EnvType envType, Map<String, Set<ModCandidateImpl>> envDisabledMods) throws ModResolutionException {
Expand Down Expand Up @@ -144,7 +145,10 @@ private static List<ModCandidateImpl> findCompatibleSet(Collection<ModCandidateI
}
}

DependencyGuiData dependencyGuiData = ResultAnalyzer.gatherErrorData(result, selectedMods, modsById, envDisabledMods, envType);

throw new ModResolutionException("Some of your mods are incompatible with the game or each other!%s",
dependencyGuiData,
ResultAnalyzer.gatherErrors(result, selectedMods, modsById, envDisabledMods, envType));
}

Expand Down
Loading