From 9ffd0e80bbb3feace231553d6539124585b03e3c Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 6 May 2026 03:36:16 -0100 Subject: change panicking functions in Client and EntityRef to return an AzaleaResult instead --- azalea/src/client_impl/client_information.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'azalea/src/client_impl/client_information.rs') 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(()) } } -- cgit v1.2.3