Skip to content

Commit be89aea

Browse files
committed
Some small things
1 parent c54ad4d commit be89aea

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,17 @@ public Stream<LoadOption> children() {
488488
@Override
489489
public void dotGraphEdge(LoadOption from, PrintWriter dotGraph) {
490490
dotGraph.printf("\t%s->%s [label=\"Breaks\", dir=both, color=red];\n", from.hashCode(), breaks.hashCode());
491-
if(rule.unless != null) {
492-
for (LoadOption option : rule.unless.getNodesTo()) {
493-
dotGraph.printf("\t%s->%s [label=\"Unless\", color=blue];\n", from.hashCode(), option.hashCode());
491+
if (rule.unless != null) {
492+
if (rule.unless instanceof QuiltRuleDepOnly) {
493+
for (LoadOption option : rule.unless.getNodesTo()) {
494+
dotGraph.printf("\t%s->%s [label=\"Unless\", color=blue];\n", from.hashCode(), option.hashCode());
495+
}
496+
} else if (rule.unless instanceof QuiltRuleDepAny) {
497+
for (QuiltRuleDepOnly only : ((QuiltRuleDepAny) rule.unless).options) {
498+
for (LoadOption option : only.getNodesTo()) {
499+
dotGraph.printf("\t%s->%s [label=\"Unless\", color=blue];\n", from.hashCode(), option.hashCode());
500+
}
501+
}
494502
}
495503
}
496504
}
@@ -654,10 +662,10 @@ public Stream<LoadOption> children() {
654662

655663
@Override
656664
public void dotGraphEdge(LoadOption from, PrintWriter dotGraph) {
657-
dotGraph.printf("\t%s->%s [label=\"Depends\"];\n", from.hashCode(), depends.hashCode());
658-
dotGraph.printf("\t%s [label=\"Any Of\", shape=\"invtriangle\"];\n", depends.hashCode());
665+
dotGraph.printf("\t%s->%s [label=\"Depends\"];\n", from.hashCode(), depends.hashCode() + 31);
666+
dotGraph.printf("\t%s [label=\"Any Of\", shape=\"invtriangle\"];\n", depends.hashCode() + 31);
659667
for (LoadOption b : depends) {
660-
dotGraph.printf("\t%s->%s [label=\"Depends\"];\n", depends.hashCode(), b.hashCode());
668+
dotGraph.printf("\t%s->%s [label=\"Depends\"];\n", depends.hashCode() + 31, b.hashCode());
661669
}
662670
}
663671

src/test/java/net/fabricmc/test/ModResolvingTests.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
package net.fabricmc.test;
1818

1919
import java.io.File;
20-
import java.io.IOException;
2120
import java.io.PrintWriter;
2221
import java.io.StringWriter;
23-
import java.nio.file.Files;
2422
import java.nio.file.Path;
25-
import java.nio.file.StandardOpenOption;
2623
import java.util.HashMap;
2724
import java.util.Map.Entry;
2825

@@ -418,17 +415,6 @@ private static void resolveErrorSet(String subpath) {
418415
fail(sb.toString());
419416
} catch (ModResolutionException ignored) {
420417
// Correct
421-
try {
422-
Path result = new File(System.getProperty("user.dir")).toPath().resolve("results").resolve("error").resolve(subpath + ".txt");
423-
Files.createDirectories(result.getParent());
424-
Files.write(
425-
result,
426-
ignored.getMessage().getBytes(),
427-
StandardOpenOption.WRITE, StandardOpenOption.CREATE
428-
);
429-
} catch (IOException e) {
430-
throw new RuntimeException(e);
431-
}
432418
}
433419
}
434420

0 commit comments

Comments
 (0)