mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
20 lines
456 B
Rust
20 lines
456 B
Rust
use crate::Client;
|
|
use azalea_protocol::ServerAddress;
|
|
|
|
///! Connect to Minecraft servers.
|
|
|
|
/// Something that can join Minecraft servers.
|
|
pub struct Account {
|
|
pub username: String,
|
|
}
|
|
impl Account {
|
|
pub fn offline(username: &str) -> Self {
|
|
Self {
|
|
username: username.to_string(),
|
|
}
|
|
}
|
|
|
|
pub async fn join(&self, address: &ServerAddress) -> Result<Client, String> {
|
|
Client::join(self, address).await
|
|
}
|
|
}
|