1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00
azalea/azalea-client/src/account.rs
2022-06-19 22:01:54 -05:00

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
}
}