From 74b295d46ab35b484f063eeb529ebd09ef05e21d Mon Sep 17 00:00:00 2001 From: JunkyDeveloper Date: Sat, 4 Apr 2026 03:07:58 +0200 Subject: [PATCH 1/2] What @tn-lorenz want's to have --- steel-registry/src/entity_types.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/steel-registry/src/entity_types.rs b/steel-registry/src/entity_types.rs index d5f7bf25484..745eefb5df2 100644 --- a/steel-registry/src/entity_types.rs +++ b/steel-registry/src/entity_types.rs @@ -22,7 +22,12 @@ pub struct EntityDimensions { pub height: f32, pub eye_height: f32, } - +impl PartialEq for EntityDimensions { + #[expect(clippy::disallowed_methods)] // This IS the PartialEq impl; ptr::eq is correct here + fn eq(&self, other: &Self) -> bool { + std::ptr::eq(self, other) + } +} impl EntityDimensions { /// Creates new entity dimensions. #[must_use] @@ -65,7 +70,12 @@ pub struct EntityFlags { pub can_breathe_underwater: bool, pub can_be_seen_as_enemy: bool, } - +impl PartialEq for EntityFlags { + #[expect(clippy::disallowed_methods)] // This IS the PartialEq impl; ptr::eq is correct here + fn eq(&self, other: &Self) -> bool { + std::ptr::eq(self, other) + } +} #[derive(Debug)] pub struct EntityType { pub key: Identifier, @@ -95,6 +105,13 @@ pub struct EntityType { pub type EntityTypeRef = &'static EntityType; +impl PartialEq for EntityTypeRef { + #[expect(clippy::disallowed_methods)] // This IS the PartialEq impl; ptr::eq is correct here + fn eq(&self, other: &Self) -> bool { + std::ptr::eq(*self, *other) + } +} + pub struct EntityTypeRegistry { types_by_id: Vec, types_by_key: FxHashMap, From 15b7fffa65428233c7706e8744f5202fb2864a4e Mon Sep 17 00:00:00 2001 From: JunkyDeveloper Date: Sat, 4 Apr 2026 14:42:31 +0200 Subject: [PATCH 2/2] fixed --- steel-registry/src/entity_types.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/steel-registry/src/entity_types.rs b/steel-registry/src/entity_types.rs index 745eefb5df2..8f9f09c183c 100644 --- a/steel-registry/src/entity_types.rs +++ b/steel-registry/src/entity_types.rs @@ -16,18 +16,13 @@ pub enum MobCategory { /// Entity dimensions used for bounding box calculation. /// Bounding box is centered on X/Z with Y at entity feet. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct EntityDimensions { pub width: f32, pub height: f32, pub eye_height: f32, } -impl PartialEq for EntityDimensions { - #[expect(clippy::disallowed_methods)] // This IS the PartialEq impl; ptr::eq is correct here - fn eq(&self, other: &Self) -> bool { - std::ptr::eq(self, other) - } -} + impl EntityDimensions { /// Creates new entity dimensions. #[must_use] @@ -57,7 +52,7 @@ impl EntityDimensions { } /// Behavioral flags for entity collision and interaction. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct EntityFlags { pub is_pushable: bool, pub is_attackable: bool, @@ -70,12 +65,7 @@ pub struct EntityFlags { pub can_breathe_underwater: bool, pub can_be_seen_as_enemy: bool, } -impl PartialEq for EntityFlags { - #[expect(clippy::disallowed_methods)] // This IS the PartialEq impl; ptr::eq is correct here - fn eq(&self, other: &Self) -> bool { - std::ptr::eq(self, other) - } -} + #[derive(Debug)] pub struct EntityType { pub key: Identifier,