diff options
Diffstat (limited to 'azalea-entity/src')
| -rw-r--r-- | azalea-entity/src/plugin/indexing.rs | 6 | ||||
| -rw-r--r-- | azalea-entity/src/plugin/mod.rs | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/azalea-entity/src/plugin/indexing.rs b/azalea-entity/src/plugin/indexing.rs index 21dd273a..fefecb06 100644 --- a/azalea-entity/src/plugin/indexing.rs +++ b/azalea-entity/src/plugin/indexing.rs @@ -7,7 +7,7 @@ use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId} use bevy_ecs::{ component::Component, entity::Entity, - query::{Added, Changed}, + query::{Added, Changed, Without}, system::{Commands, Query, Res, ResMut, Resource}, }; use derive_more::{Deref, DerefMut}; @@ -16,7 +16,7 @@ use tracing::{debug, warn}; use uuid::Uuid; use super::LoadedBy; -use crate::{EntityUuid, Position}; +use crate::{EntityUuid, LocalEntity, Position}; #[derive(Resource, Default)] pub struct EntityUuidIndex { @@ -152,7 +152,7 @@ pub fn remove_despawned_entities_from_indexes( &InstanceName, &LoadedBy, ), - Changed<LoadedBy>, + (Changed<LoadedBy>, Without<LocalEntity>), >, ) { for (entity, uuid, minecraft_id, position, instance_name, loaded_by) in &query { diff --git a/azalea-entity/src/plugin/mod.rs b/azalea-entity/src/plugin/mod.rs index bddb4b66..b6ae369f 100644 --- a/azalea-entity/src/plugin/mod.rs +++ b/azalea-entity/src/plugin/mod.rs @@ -206,6 +206,9 @@ pub fn update_bounding_box(mut query: Query<(&Position, &mut Physics), Changed<P /// Marks an entity that's in a loaded chunk. This is updated at the beginning /// of every tick. +/// +/// Internally, this is only used for player physics. Not to be confused with +/// the somewhat similarly named [`LoadedBy`]. #[derive(Component, Clone, Debug, Copy)] pub struct InLoadedChunk; |
