clean up the dump command's output

This commit is contained in:
Ell 2024-11-28 12:42:18 +01:00
parent 887bfed229
commit 9fc0c12bf9

View file

@ -104,13 +104,12 @@ public class PipeNetwork extends SavedData implements GraphListener<BlockPos, Ne
@Override
public String toString() {
return "PipeNetwork{" +
"\ngraph=" + this.graph +
",\nnodeToConnectedNodes=" + this.nodeToConnectedNodes +
",\ntileCache=" + this.tileCache.keySet() +
",\npipeItems=" + this.pipeItems +
",\nnetworkLocks=" + this.networkLocks +
",\nactiveCrafts=" + this.activeCrafts + '}';
return "graph:\n\tnodes: " + this.graph.edgeSet() + "\n\tedges: " + this.graph.edgeSet() +
"\nnodeToConnectedNodes:\n" + PipeNetwork.toNewlineDelimitedString(this.nodeToConnectedNodes.entrySet()) +
"\ntileCache:\n" + PipeNetwork.toNewlineDelimitedString(this.tileCache.keySet()) +
"\npipeItems:\n" + PipeNetwork.toNewlineDelimitedString(this.pipeItems.entries()) +
"\nnetworkLocks:\n" + PipeNetwork.toNewlineDelimitedString(this.networkLocks.entries()) +
"\nactiveCrafts:\n" + PipeNetwork.toNewlineDelimitedString(this.activeCrafts.entries());
}
@Override
@ -594,4 +593,8 @@ public class PipeNetwork extends SavedData implements GraphListener<BlockPos, Ne
}
}
private static String toNewlineDelimitedString(Collection<?> collection) {
return collection.stream().map(c -> "\t" + c.toString()).collect(Collectors.joining("\n"));
}
}