aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/account.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src/account.rs')
-rw-r--r--azalea-client/src/account.rs27
1 files changed, 27 insertions, 0 deletions
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, String> {
+ Client::join(self, address).await
+ }
+}