diff options
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/client.rs | 5 | ||||
| -rwxr-xr-x | azalea-client/src/player.rs | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 8e1a7938..d9214329 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -64,6 +64,9 @@ pub type ClientInformation = ServerboundClientInformationPacket; /// To make a new client, use either [`azalea::ClientBuilder`] or /// [`Client::join`]. /// +/// Note that `Client` is inaccessible from systems (i.e. plugins), but you can +/// achieve everything that client can do with events. +/// /// [`azalea::ClientBuilder`]: https://docs.rs/azalea/latest/azalea/struct.ClientBuilder.html #[derive(Clone)] pub struct Client { @@ -467,6 +470,8 @@ impl Client { } /// Get a HashMap of all the players in the tab list. + /// + /// Internally, this fetches the `players` field in [`LocalPlayer`]. pub fn players(&mut self) -> HashMap<Uuid, PlayerInfo> { self.local_player(&mut self.ecs.lock()).players.clone() } diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs index b8ca83bb..3680e2d0 100755 --- a/azalea-client/src/player.rs +++ b/azalea-client/src/player.rs @@ -13,12 +13,16 @@ use crate::{packet_handling::AddPlayerEvent, GameProfileComponent}; /// A player in the tab list. #[derive(Debug, Clone)] pub struct PlayerInfo { + /// Information about the player's Minecraft account, including their + /// username. pub profile: GameProfile, /// The player's UUID. pub uuid: Uuid, pub gamemode: GameType, pub latency: i32, - /// The player's display name in the tab list. + /// The player's display name in the tab list, but only if it's different + /// from the player's normal username. Use `player_info.profile.name` to get + /// the player's actual username. pub display_name: Option<FormattedText>, } |
