From 04f5e0e8c2d5cd5d8d250fd0c1622493a249dc68 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Sat, 1 Mar 2025 16:32:59 -0500 Subject: [PATCH] fix(client/world): wrap Owneruuid in Option --- src/lua/client/world.rs | 42 +++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/lua/client/world.rs b/src/lua/client/world.rs index 9fd5793..ad500a2 100644 --- a/src/lua/client/world.rs +++ b/src/lua/client/world.rs @@ -55,32 +55,32 @@ pub async fn find_entities( ) -> Result> { let entities = { let mut ecs = client.ecs.lock(); - ecs.query_filtered::<( + ecs.query::<( &AzaleaPosition, &CustomName, &EntityKind, &EntityUuid, &LookDirection, &MinecraftEntityId, - &Owneruuid, + Option<&Owneruuid>, &Pose, - ), Without>() - .iter(&ecs) - .map( - |(position, custom_name, kind, uuid, direction, id, owner_uuid, pose)| { - ( - Vec3::from(position), - custom_name.as_ref().map(ToString::to_string), - kind.to_string(), - uuid.to_string(), - Direction::from(direction), - id.0, - owner_uuid.to_owned(), - *pose as u8, - ) - }, - ) - .collect::>() + )>() + .iter(&ecs) + .map( + |(position, custom_name, kind, uuid, direction, id, owner_uuid, pose)| { + ( + Vec3::from(position), + custom_name.as_ref().map(ToString::to_string), + kind.to_string(), + uuid.to_string(), + Direction::from(direction), + id.0, + owner_uuid.map(ToOwned::to_owned), + *pose as u8, + ) + }, + ) + .collect::>() }; let mut matched = Vec::new(); @@ -92,7 +92,9 @@ pub async fn find_entities( entity.set("uuid", uuid)?; entity.set("direction", direction)?; entity.set("id", id)?; - if let Some(uuid) = *owner_uuid { + if let Some(v) = owner_uuid + && let Some(uuid) = *v + { entity.set("owner_uuid", uuid.to_string())?; } entity.set("pose", pose)?;