aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/client_impl/attack.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-05-06 03:36:16 -0100
committermat <git@matdoes.dev>2026-05-07 08:05:58 -1200
commit9ffd0e80bbb3feace231553d6539124585b03e3c (patch)
treead8df7d07df9f8f542e288c263d76b8ffd637416 /azalea/src/client_impl/attack.rs
parent4d1f430408dc6854c1af5fb14b2641e293a9cf43 (diff)
downloadazalea-drasl-9ffd0e80bbb3feace231553d6539124585b03e3c.tar.xz
change panicking functions in Client and EntityRef to return an AzaleaResult instead
Diffstat (limited to 'azalea/src/client_impl/attack.rs')
-rw-r--r--azalea/src/client_impl/attack.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/azalea/src/client_impl/attack.rs b/azalea/src/client_impl/attack.rs
index 16721c1c..cdb4c0b1 100644
--- a/azalea/src/client_impl/attack.rs
+++ b/azalea/src/client_impl/attack.rs
@@ -22,9 +22,9 @@ impl Client {
///
/// Also see [`Client::attack_cooldown_remaining_ticks`].
pub fn has_attack_cooldown(&self) -> bool {
- let Some(attack_strength_scale) = self.get_component::<AttackStrengthScale>() else {
+ let Ok(attack_strength_scale) = self.component::<AttackStrengthScale>() else {
// they don't even have an AttackStrengthScale so they probably can't even
- // attack? whatever, just return false
+ // attack. whatever, just return false
return false;
};
**attack_strength_scale < 1.0