diff options
| author | mat <git@matdoes.dev> | 2026-05-06 03:36:16 -0100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-05-07 08:05:58 -1200 |
| commit | 9ffd0e80bbb3feace231553d6539124585b03e3c (patch) | |
| tree | ad8df7d07df9f8f542e288c263d76b8ffd637416 /azalea/src/client_impl/client_information.rs | |
| parent | 4d1f430408dc6854c1af5fb14b2641e293a9cf43 (diff) | |
| download | azalea-drasl-9ffd0e80bbb3feace231553d6539124585b03e3c.tar.xz | |
change panicking functions in Client and EntityRef to return an AzaleaResult instead
Diffstat (limited to 'azalea/src/client_impl/client_information.rs')
| -rw-r--r-- | azalea/src/client_impl/client_information.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/azalea/src/client_impl/client_information.rs b/azalea/src/client_impl/client_information.rs index b3cf7927..3b408d58 100644 --- a/azalea/src/client_impl/client_information.rs +++ b/azalea/src/client_impl/client_information.rs @@ -2,7 +2,7 @@ use azalea_client::ClientInformation; use azalea_protocol::packets::game; use tracing::debug; -use crate::Client; +use crate::{Client, client_impl::error::AzaleaResult}; impl Client { /// Tell the server we changed our game options (i.e. render distance, main @@ -20,10 +20,13 @@ impl Client { /// # Ok(()) /// # } /// ``` - pub fn set_client_information(&self, client_information: ClientInformation) { + pub fn set_client_information( + &self, + client_information: ClientInformation, + ) -> AzaleaResult<()> { self.query_self::<&mut ClientInformation, _>(|mut ci| { *ci = client_information.clone(); - }); + })?; if self.logged_in() { debug!( @@ -34,5 +37,7 @@ impl Client { client_information, }); } + + Ok(()) } } |
