Skip to content

Commit d458a26

Browse files
committed
Fix the logged error for invalid dependencies always reporting as the desired mod is missing, rather than including the actual present version.
This was a pretty common problem, since quilt-loader provides fabric-loader, and I've been pretty slow at updating at.
1 parent d225bb6 commit d458a26

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

src/main/java/org/quiltmc/loader/impl/plugin/SolverErrorHelper.java

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -690,13 +690,34 @@ void report(QuiltPluginManagerImpl manager) {
690690
} else {
691691
report.append(" version ").append(versionsOn).append(" of ");
692692
}
693-
report.append(modOn);// TODO
694-
report.append(", which is missing!");
695-
error.appendReportText(report.toString(), "");
696-
697-
for (ModLoadOption mod : from) {
698-
error.appendReportText("- " + manager.describePath(mod.from()));
693+
report.append(modOn);
694+
if (allInvalidOptions.isEmpty()) {
695+
report.append(", which is missing!");
696+
} else {
697+
report.append(", but only wrong versions are present:\n");
698+
for (ModLoadOption option : allInvalidOptions) {
699+
report.append("\n- version ");
700+
report.append(option.version());
701+
ModLoadOption real = null;
702+
if (option instanceof AliasedLoadOption) {
703+
LoadOption target = ((AliasedLoadOption) option).getTarget();
704+
if (target instanceof ModLoadOption) {
705+
real = (ModLoadOption) target;
706+
}
707+
}
708+
if (real != null) {
709+
report.append(" provided by ");
710+
report.append(real.metadata().name());
711+
}
712+
report.append(" from ");
713+
report.append(manager.describePath(option.from()));
714+
}
699715
}
716+
error.appendReportText(report.toString(), "");
717+
718+
for (ModLoadOption mod : from) {
719+
error.appendReportText(mod.metadata().name() + " is loaded from " + manager.describePath(mod.from()));
720+
}
700721
}
701722
}
702723

0 commit comments

Comments
 (0)