diff options
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/client.rs | 13 | ||||
| -rwxr-xr-x | azalea-client/src/lib.rs | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 8393a977..3d6c8e05 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -135,7 +135,9 @@ pub enum HandleError { impl Client { /// Connect to a Minecraft server. /// - /// To change the render distance and other settings, use [`Client::set_client_information`]. + /// To change the render distance and other settings, use + /// [`Client::set_client_information`]. To watch for events like packets + /// sent by the server, use the `rx` variable this function returns. /// /// # Examples /// @@ -145,7 +147,7 @@ impl Client { /// #[tokio::main] /// async fn main() -> Box<dyn std::error::Error> { /// let account = Account::offline("bot"); - /// let client = Client::join(&account, "localhost").await?; + /// let (client, rx) = Client::join(&account, "localhost").await?; /// client.chat("Hello, world!").await?; /// client.shutdown().await?; /// } @@ -583,9 +585,10 @@ impl Client { if let Err(e) = client .dimension .lock() - .replace_with_packet_data(&pos, &mut Cursor::new(&p.chunk_data.data)) { - error!("Couldn't set chunk data: {}", e); - } + .replace_with_packet_data(&pos, &mut Cursor::new(&p.chunk_data.data)) + { + error!("Couldn't set chunk data: {}", e); + } } ClientboundGamePacket::LightUpdate(_p) => { // debug!("Got light update packet {:?}", p); diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index c32bd212..7a76e103 100755 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -1,5 +1,5 @@ //! Significantly abstract [`azalea_protocol`] so it's actually useable for -//! real clients. If you want to make bots, however, you should use the +//! real clients. If you want to make bots, you should use the //! [`azalea`] crate instead. //! //! [`azalea_protocol`]: https://crates.io/crates/azalea-protocol |
