From fc3151f89db1cf018bfebebb8f102e20911e64d3 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 18 Jun 2022 16:54:49 -0500 Subject: account.rs and client.rs --- azalea-client/src/account.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 azalea-client/src/account.rs (limited to 'azalea-client/src/account.rs') diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs new file mode 100644 index 00000000..00a5d0f6 --- /dev/null +++ b/azalea-client/src/account.rs @@ -0,0 +1,27 @@ +use crate::Client; +use azalea_protocol::{ + packets::game::{ + clientbound_player_chat_packet::ClientboundPlayerChatPacket, + clientbound_system_chat_packet::ClientboundSystemChatPacket, + }, + ServerAddress, +}; +use std::fmt::Debug; + +///! 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::join(self, address).await + } +} -- cgit v1.2.3