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 @Override
public String toString() { public String toString() {
return "PipeNetwork{" + return "graph:\n\tnodes: " + this.graph.edgeSet() + "\n\tedges: " + this.graph.edgeSet() +
"\ngraph=" + this.graph + "\nnodeToConnectedNodes:\n" + PipeNetwork.toNewlineDelimitedString(this.nodeToConnectedNodes.entrySet()) +
",\nnodeToConnectedNodes=" + this.nodeToConnectedNodes + "\ntileCache:\n" + PipeNetwork.toNewlineDelimitedString(this.tileCache.keySet()) +
",\ntileCache=" + this.tileCache.keySet() + "\npipeItems:\n" + PipeNetwork.toNewlineDelimitedString(this.pipeItems.entries()) +
",\npipeItems=" + this.pipeItems + "\nnetworkLocks:\n" + PipeNetwork.toNewlineDelimitedString(this.networkLocks.entries()) +
",\nnetworkLocks=" + this.networkLocks + "\nactiveCrafts:\n" + PipeNetwork.toNewlineDelimitedString(this.activeCrafts.entries());
",\nactiveCrafts=" + this.activeCrafts + '}';
} }
@Override @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"));
}
} }