aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-entity/src/plugin')
-rw-r--r--azalea-entity/src/plugin/indexing.rs7
-rw-r--r--azalea-entity/src/plugin/mod.rs16
-rw-r--r--azalea-entity/src/plugin/relative_updates.rs10
3 files changed, 19 insertions, 14 deletions
diff --git a/azalea-entity/src/plugin/indexing.rs b/azalea-entity/src/plugin/indexing.rs
index f1926286..6f170dc6 100644
--- a/azalea-entity/src/plugin/indexing.rs
+++ b/azalea-entity/src/plugin/indexing.rs
@@ -45,9 +45,10 @@ impl EntityUuidIndex {
}
}
-/// An index of Minecraft entity IDs to Azalea ECS entities. This is a
-/// `Component` so local players can keep track of entity IDs independently from
-/// the instance.
+/// An index of Minecraft entity IDs to Azalea ECS entities.
+///
+/// This is a `Component` so local players can keep track of entity IDs
+/// independently from the instance.
///
/// If you need a per-instance instead of per-client version of this, you can
/// use [`Instance::entity_by_id`].
diff --git a/azalea-entity/src/plugin/mod.rs b/azalea-entity/src/plugin/mod.rs
index e20ed860..a3ea11d0 100644
--- a/azalea-entity/src/plugin/mod.rs
+++ b/azalea-entity/src/plugin/mod.rs
@@ -80,8 +80,9 @@ fn debug_new_entity(query: Query<(Entity, Option<&LocalEntity>), Added<Minecraft
}
/// System that adds the [`Dead`] marker component if an entity's health is set
-/// to 0 (or less than 0). This will be present if an entity is doing the death
-/// animation.
+/// to 0 (or less than 0).
+///
+/// This will be present if an entity is doing the death animation.
///
/// Entities that are dead cannot be revived.
pub fn add_dead(mut commands: Commands, query: Query<(Entity, &Health), Changed<Health>>) {
@@ -188,7 +189,9 @@ fn is_trapdoor_useable_as_ladder(
}
/// A component that lists all the local player entities that have this entity
-/// loaded. If this is empty, the entity will be removed from the ECS.
+/// loaded.
+///
+/// If this is empty, the entity will be removed from the ECS.
#[derive(Component, Clone, Deref, DerefMut)]
pub struct LoadedBy(pub HashSet<Entity>);
@@ -203,10 +206,13 @@ pub fn apply_clamp_look_direction(mut look_direction: LookDirection) -> LookDire
look_direction
}
-/// Sets the position of the entity. This doesn't update the cache in
-/// azalea-world, and should only be used within azalea-world!
+/// Sets the position of the entity.
+///
+/// This doesn't update the cache in azalea-world, and should only be used
+/// within azalea-world.
///
/// # Safety
+///
/// Cached position in the world must be updated.
#[allow(clippy::type_complexity)]
pub fn update_bounding_box(
diff --git a/azalea-entity/src/plugin/relative_updates.rs b/azalea-entity/src/plugin/relative_updates.rs
index 1c0a899f..3917c946 100644
--- a/azalea-entity/src/plugin/relative_updates.rs
+++ b/azalea-entity/src/plugin/relative_updates.rs
@@ -54,6 +54,7 @@ impl RelativeEntityUpdate {
}
/// A component that counts the number of times this entity has been modified.
+///
/// This is used for making sure two clients don't do the same relative update
/// on an entity.
///
@@ -102,15 +103,12 @@ impl EntityCommand for RelativeEntityUpdate {
}
}
-/// The [`UpdatesReceived`] component should never be on [`LocalEntity`]
-/// entities. This warns if an entity has both components.
+/// A system that logs a warning if an entity has both [`UpdatesReceived`]
+/// and [`LocalEntity`].
pub fn debug_detect_updates_received_on_local_entities(
query: Query<Entity, (With<LocalEntity>, With<UpdatesReceived>)>,
) {
for entity in &query {
- warn!(
- "Entity {:?} has both LocalEntity and UpdatesReceived",
- entity
- );
+ warn!("Entity {entity:?} has both LocalEntity and UpdatesReceived");
}
}