Compare commits
2 Commits
89091a3fd5
...
5b8e2280e3
Author | SHA1 | Date | |
---|---|---|---|
5b8e2280e3 | |||
04f5e0e8c2 |
@ -54,7 +54,7 @@ pub async fn go_to(
|
||||
};
|
||||
let (goal_type, options) = if let Some(metadata) = metadata {
|
||||
(
|
||||
metadata.get("type")?,
|
||||
metadata.get("type").unwrap_or_default(),
|
||||
metadata.get("options").unwrap_or(lua.create_table()?),
|
||||
)
|
||||
} else {
|
||||
|
@ -55,16 +55,16 @@ pub async fn find_entities(
|
||||
) -> Result<Vec<Table>> {
|
||||
let entities = {
|
||||
let mut ecs = client.ecs.lock();
|
||||
ecs.query_filtered::<(
|
||||
ecs.query::<(
|
||||
&AzaleaPosition,
|
||||
&CustomName,
|
||||
&EntityKind,
|
||||
&EntityUuid,
|
||||
&LookDirection,
|
||||
&MinecraftEntityId,
|
||||
&Owneruuid,
|
||||
Option<&Owneruuid>,
|
||||
&Pose,
|
||||
), Without<Dead>>()
|
||||
)>()
|
||||
.iter(&ecs)
|
||||
.map(
|
||||
|(position, custom_name, kind, uuid, direction, id, owner_uuid, pose)| {
|
||||
@ -75,7 +75,7 @@ pub async fn find_entities(
|
||||
uuid.to_string(),
|
||||
Direction::from(direction),
|
||||
id.0,
|
||||
owner_uuid.to_owned(),
|
||||
owner_uuid.map(ToOwned::to_owned),
|
||||
*pose as u8,
|
||||
)
|
||||
},
|
||||
@ -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)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user