private TagStringWriter writeList(final ListBinaryTag tag) throws IOException {
    this.beginList();
    int idx = 0;
    final boolean lineBreaks = this.prettyPrinting() && this.breakListElement(tag.elementType());
    for (final BinaryTag el : tag) {
      this.printAndResetSeparator(!lineBreaks);
      if (lineBreaks) {
        this.newlineIndent();
      }
      if (this.legacy) {
        this.out.append(String.valueOf(idx++));
        this.appendSeparator(Tokens.COMPOUND_KEY_TERMINATOR);
      }

      this.writeTag(el);
    }
    this.endList(lineBreaks);
    return this;
  }
Whether a {@link Tokens#VALUE_SEPARATOR} needs to be printed before the beginning of the next object.
nbt/src/main/java/net/kyori/adventure/nbt/TagStringWriter.java