default @NotNull CompoundBinaryTag getCompound(final @Range(from = 0, to = Integer.MAX_VALUE) int index, final @NotNull CompoundBinaryTag defaultValue) {
    final BinaryTag tag = this.get(index);
    if (tag.type() == BinaryTagTypes.COMPOUND) {
      return (CompoundBinaryTag) tag;
    }
    return defaultValue;
  }
Gets a compound.

@param index the index
@param defaultValue the default value
@return the compound, or {@code defaultValue}
@since 4.0.0
nbt/src/main/java/net/kyori/adventure/nbt/ListBinaryTag.java