diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-01 22:28:53 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-01 22:28:53 -0600 |
| commit | 1ca1f1d9e27aeea3adaf359570f2e211e0a9af74 (patch) | |
| tree | dd35bb9bff67f0622a6410c99b5bd1678c9c8299 /azalea | |
| parent | 7b84235a9be5bdc7c05873467ad8310b57448d79 (diff) | |
| download | azalea-drasl-1ca1f1d9e27aeea3adaf359570f2e211e0a9af74.tar.xz | |
Extensible Account (#301)
* refactor Account
* clean up implementation and docs
* add AccountTrait::join
* update changelog
* update example
Diffstat (limited to 'azalea')
| -rw-r--r-- | azalea/examples/nearest_entity.rs | 2 | ||||
| -rw-r--r-- | azalea/examples/testbot/main.rs | 2 | ||||
| -rw-r--r-- | azalea/src/auto_reconnect.rs | 2 | ||||
| -rw-r--r-- | azalea/src/builder.rs | 2 | ||||
| -rw-r--r-- | azalea/src/client_impl/entity_query.rs | 2 | ||||
| -rw-r--r-- | azalea/src/client_impl/mod.rs | 3 | ||||
| -rw-r--r-- | azalea/src/prelude.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/builder.rs | 2 | ||||
| -rw-r--r-- | azalea/src/swarm/mod.rs | 4 |
9 files changed, 11 insertions, 10 deletions
diff --git a/azalea/examples/nearest_entity.rs b/azalea/examples/nearest_entity.rs index a0385917..418297b5 100644 --- a/azalea/examples/nearest_entity.rs +++ b/azalea/examples/nearest_entity.rs @@ -4,7 +4,7 @@ use azalea::{ nearest_entity::EntityFinder, prelude::*, }; -use azalea_client::Account; +use azalea_client::account::Account; use azalea_core::tick::GameTick; use azalea_entity::{ LocalEntity, Position, diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 9889e250..b2ad0b61 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -190,7 +190,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu async fn swarm_handle(_swarm: Swarm, event: SwarmEvent, _state: SwarmState) -> anyhow::Result<()> { match &event { SwarmEvent::Disconnect(account, _join_opts) => { - println!("bot got kicked! {}", account.username); + println!("bot got kicked! {}", account.username()); } SwarmEvent::Chat(chat) => { if chat.message().to_string() == "The particle was not visible for anybody" { diff --git a/azalea/src/auto_reconnect.rs b/azalea/src/auto_reconnect.rs index dd353b7a..3ab08f27 100644 --- a/azalea/src/auto_reconnect.rs +++ b/azalea/src/auto_reconnect.rs @@ -11,7 +11,7 @@ use super::{ disconnect::DisconnectEvent, join::{ConnectOpts, ConnectionFailedEvent, StartJoinServerEvent}, }; -use crate::Account; +use crate::account::Account; /// The default delay that Azalea will use for reconnecting our clients. /// diff --git a/azalea/src/builder.rs b/azalea/src/builder.rs index 8151b3a1..db51de63 100644 --- a/azalea/src/builder.rs +++ b/azalea/src/builder.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use azalea_client::{Account, DefaultPlugins}; +use azalea_client::{DefaultPlugins, account::Account}; use azalea_protocol::address::ResolvableAddr; use bevy_app::{AppExit, Plugins}; use bevy_ecs::component::Component; diff --git a/azalea/src/client_impl/entity_query.rs b/azalea/src/client_impl/entity_query.rs index 268eaaf1..44fbe9e8 100644 --- a/azalea/src/client_impl/entity_query.rs +++ b/azalea/src/client_impl/entity_query.rs @@ -189,7 +189,7 @@ impl Client { &self, predicate: impl EntityPredicate<Q, F>, ) -> Option<Entity> { - let instance_name = self.get_component::<InstanceName>()?; + let instance_name = self.get_component::<InstanceName>()?.clone(); predicate.find_any(self.ecs.clone(), &instance_name) } diff --git a/azalea/src/client_impl/mod.rs b/azalea/src/client_impl/mod.rs index e3876f2e..db9ecf91 100644 --- a/azalea/src/client_impl/mod.rs +++ b/azalea/src/client_impl/mod.rs @@ -2,7 +2,8 @@ use std::{collections::HashMap, sync::Arc}; use azalea_auth::game_profile::GameProfile; use azalea_client::{ - Account, DefaultPlugins, + DefaultPlugins, + account::Account, connection::RawConnection, disconnect::DisconnectEvent, join::{ConnectOpts, StartJoinServerEvent}, diff --git a/azalea/src/prelude.rs b/azalea/src/prelude.rs index d39e50c4..ad895bcb 100644 --- a/azalea/src/prelude.rs +++ b/azalea/src/prelude.rs @@ -1,7 +1,7 @@ //! The Azalea prelude. Things that are necessary for a bare-bones bot are //! re-exported here. -pub use azalea_client::Account; +pub use azalea_client::account::Account; pub use azalea_core::tick::GameTick; pub use bevy_app::AppExit; diff --git a/azalea/src/swarm/builder.rs b/azalea/src/swarm/builder.rs index 4312a485..14c9c290 100644 --- a/azalea/src/swarm/builder.rs +++ b/azalea/src/swarm/builder.rs @@ -8,7 +8,7 @@ use std::{ time::Duration, }; -use azalea_client::{Account, DefaultPlugins, start_ecs_runner}; +use azalea_client::{DefaultPlugins, account::Account, start_ecs_runner}; use azalea_protocol::address::{ResolvableAddr, ResolvedAddr}; use azalea_world::InstanceContainer; use bevy_app::{App, AppExit, Plugins, SubApp}; diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 691fb354..b1061346 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -12,7 +12,7 @@ use std::sync::{ atomic::{self, AtomicBool}, }; -use azalea_client::{Account, chat::ChatPacket, join::ConnectOpts}; +use azalea_client::{account::Account, chat::ChatPacket, join::ConnectOpts}; use azalea_entity::LocalEntity; use azalea_protocol::address::ResolvedAddr; use azalea_world::InstanceContainer; @@ -165,7 +165,7 @@ impl Swarm { ) -> Client { debug!( "add_with_opts called for account {} with opts {join_opts:?}", - account.username + account.username() ); let mut address = self.address.read().clone(); |
