fn main() -> Result<(), Box<dyn std::error::Error>> {
    let invocation = minecraft_server::SupervisorInvocation::from_process_arguments()?;

    let xdg_dirs =
        xdg::BaseDirectories::with_prefix(minecraft_server::CONSTANTS.java_server_xdg_subdirectory);

    let working_directory_environment_variable_value =
        std::env::var(minecraft_server::CONSTANTS.working_directory_environment_variable);

    let config = minecraft_server::JavaConfig::build_vanilla(
        &invocation,
        &xdg_dirs,
        &working_directory_environment_variable_value,
    )?;
    minecraft_server::run_java_server(&config)
}
