# msjm — Minecraft Server Jar Manager

A Rust library for fetching Minecraft server JAR download URLs across multiple platforms.

## Supported Platforms

| Platform | Source |
|----------|--------|
| `vanilla` | [liebki/MinecraftServerForkDownloads](https://github.com/liebki/MinecraftServerForkDownloads) |
| `paper` | [liebki/MinecraftServerForkDownloads](https://github.com/liebki/MinecraftServerForkDownloads) |
| `fabric` | [liebki/MinecraftServerForkDownloads](https://github.com/liebki/MinecraftServerForkDownloads) |
| `forge` | [liebki/MinecraftServerForkDownloads](https://github.com/liebki/MinecraftServerForkDownloads) |
| `spigot` | [liebki/MinecraftServerForkDownloads](https://github.com/liebki/MinecraftServerForkDownloads) |
| `sponge` | [liebki/MinecraftServerForkDownloads](https://github.com/liebki/MinecraftServerForkDownloads) |

## Usage

```toml
[dependencies]
msjm = { path = "." }
reqwest = "0.13"
```

```rust
use msjm::{get_platforms, get_versions, download};

#[tokio::main]
async fn main() {
    // List all supported platforms
    for platform in get_platforms() {
        println!("{}", platform);
    }

    // Get available versions for a platform
    let versions = get_versions("paper").await.unwrap();
    println!("{:?}", versions);

    // Get the download URL for a specific version
    let url = download("paper", "1.21.4").await.unwrap();
    println!("{}", url);
}
```

## API

### `get_platforms() -> &'static [&'static str]`

Returns a list of all supported platform names.

### `get_versions(platform: &str) -> Result<Vec<String>, String>`

Returns a list of available versions for the given platform, sorted newest first.

### `download(platform: &str, version: &str) -> Result<String, String>`

Returns the direct download URL for the given platform and version.
