From 585b51e91a5335eae37bc5af7c0111bb2092b156 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 20 Sep 2025 20:35:16 -1200 Subject: more accurate mining and impl PartialEq for packets --- azalea-inventory/src/components.rs | 6 +++--- azalea-inventory/src/operations.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'azalea-inventory/src') diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index f63ca1ad..ad15a461 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -41,7 +41,7 @@ pub trait EncodableDataComponent: Send + Sync + Any { // function instead fn clone(&self) -> Box; // same thing here - fn eq(&self, other: Box) -> bool; + fn eq(&self, other: &dyn EncodableDataComponent) -> bool; } impl EncodableDataComponent for T @@ -58,8 +58,8 @@ where let cloned = self.clone(); Box::new(cloned) } - fn eq(&self, other: Box) -> bool { - let other_any: Box = other; + fn eq(&self, other: &dyn EncodableDataComponent) -> bool { + let other_any: &dyn Any = other; match other_any.downcast_ref::() { Some(other) => self == other, _ => false, diff --git a/azalea-inventory/src/operations.rs b/azalea-inventory/src/operations.rs index 60bf9e64..97ae1e60 100644 --- a/azalea-inventory/src/operations.rs +++ b/azalea-inventory/src/operations.rs @@ -253,7 +253,7 @@ impl ClickOperation { } } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum ClickType { Pickup = 0, QuickMove = 1, -- cgit v1.2.3