Compare commits
No commits in common. "5b8e2280e365548d3752963cd0d6e270ea47f249" and "89091a3fd5f5111cdcd378b85ea927be881ff363" have entirely different histories.
5b8e2280e3
...
89091a3fd5
@ -54,7 +54,7 @@ pub async fn go_to(
|
|||||||
};
|
};
|
||||||
let (goal_type, options) = if let Some(metadata) = metadata {
|
let (goal_type, options) = if let Some(metadata) = metadata {
|
||||||
(
|
(
|
||||||
metadata.get("type").unwrap_or_default(),
|
metadata.get("type")?,
|
||||||
metadata.get("options").unwrap_or(lua.create_table()?),
|
metadata.get("options").unwrap_or(lua.create_table()?),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,32 +55,32 @@ pub async fn find_entities(
|
|||||||
) -> Result<Vec<Table>> {
|
) -> Result<Vec<Table>> {
|
||||||
let entities = {
|
let entities = {
|
||||||
let mut ecs = client.ecs.lock();
|
let mut ecs = client.ecs.lock();
|
||||||
ecs.query::<(
|
ecs.query_filtered::<(
|
||||||
&AzaleaPosition,
|
&AzaleaPosition,
|
||||||
&CustomName,
|
&CustomName,
|
||||||
&EntityKind,
|
&EntityKind,
|
||||||
&EntityUuid,
|
&EntityUuid,
|
||||||
&LookDirection,
|
&LookDirection,
|
||||||
&MinecraftEntityId,
|
&MinecraftEntityId,
|
||||||
Option<&Owneruuid>,
|
&Owneruuid,
|
||||||
&Pose,
|
&Pose,
|
||||||
)>()
|
), Without<Dead>>()
|
||||||
.iter(&ecs)
|
.iter(&ecs)
|
||||||
.map(
|
.map(
|
||||||
|(position, custom_name, kind, uuid, direction, id, owner_uuid, pose)| {
|
|(position, custom_name, kind, uuid, direction, id, owner_uuid, pose)| {
|
||||||
(
|
(
|
||||||
Vec3::from(position),
|
Vec3::from(position),
|
||||||
custom_name.as_ref().map(ToString::to_string),
|
custom_name.as_ref().map(ToString::to_string),
|
||||||
kind.to_string(),
|
kind.to_string(),
|
||||||
uuid.to_string(),
|
uuid.to_string(),
|
||||||
Direction::from(direction),
|
Direction::from(direction),
|
||||||
id.0,
|
id.0,
|
||||||
owner_uuid.map(ToOwned::to_owned),
|
owner_uuid.to_owned(),
|
||||||
*pose as u8,
|
*pose as u8,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut matched = Vec::new();
|
let mut matched = Vec::new();
|
||||||
@ -92,9 +92,7 @@ pub async fn find_entities(
|
|||||||
entity.set("uuid", uuid)?;
|
entity.set("uuid", uuid)?;
|
||||||
entity.set("direction", direction)?;
|
entity.set("direction", direction)?;
|
||||||
entity.set("id", id)?;
|
entity.set("id", id)?;
|
||||||
if let Some(v) = owner_uuid
|
if let Some(uuid) = *owner_uuid {
|
||||||
&& let Some(uuid) = *v
|
|
||||||
{
|
|
||||||
entity.set("owner_uuid", uuid.to_string())?;
|
entity.set("owner_uuid", uuid.to_string())?;
|
||||||
}
|
}
|
||||||
entity.set("pose", pose)?;
|
entity.set("pose", pose)?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user