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/interact.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'azalea/src/client_impl/interact.rs') diff --git a/azalea/src/client_impl/interact.rs b/azalea/src/client_impl/interact.rs index b3cda1e2..bec62c20 100644 --- a/azalea/src/client_impl/interact.rs +++ b/azalea/src/client_impl/interact.rs @@ -3,13 +3,13 @@ use azalea_core::{hit_result::HitResult, position::BlockPos}; use azalea_protocol::packets::game::s_interact::InteractionHand; use bevy_ecs::entity::Entity; -use crate::Client; +use crate::{Client, client_impl::error::AzaleaResult}; impl Client { /// Returns the current [`HitResult`], which is the block or entity in the /// client's crosshair. - pub fn hit_result(&self) -> HitResult { - (**self.component::()).clone() + pub fn hit_result(&self) -> AzaleaResult { + Ok((**self.component::()?).clone()) } /// Right-click a block. -- cgit v1.2.3