aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/lib.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-07-23 22:17:17 -0500
committermat <git@matdoes.dev>2023-07-23 22:17:17 -0500
commitd99ba0da5500a1a4917bf9c8c9e93e2caa4ada99 (patch)
tree08af266f9ccc9a6dea7593198bfe50dab2a307eb /azalea-entity/src/lib.rs
parent2ab16402de3ac12c04696833450cd8d2f7b39b85 (diff)
downloadazalea-drasl-d99ba0da5500a1a4917bf9c8c9e93e2caa4ada99.tar.xz
clean up azalea-entity a little
Diffstat (limited to 'azalea-entity/src/lib.rs')
-rw-r--r--azalea-entity/src/lib.rs36
1 files changed, 6 insertions, 30 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs
index 76c5220a..bc12e64c 100644
--- a/azalea-entity/src/lib.rs
+++ b/azalea-entity/src/lib.rs
@@ -5,33 +5,24 @@ mod data;
mod dimensions;
mod effects;
mod enchantments;
-mod info;
pub mod metadata;
pub mod mining;
-mod systems;
+mod plugin;
-use self::{attributes::AttributeInstance, metadata::Health};
+use self::attributes::AttributeInstance;
pub use attributes::Attributes;
use azalea_block::BlockState;
use azalea_core::{BlockPos, ChunkPos, ResourceLocation, Vec3, AABB};
use azalea_world::{ChunkStorage, InstanceName};
-use bevy_ecs::{
- bundle::Bundle,
- component::Component,
- entity::Entity,
- query::Changed,
- system::{Commands, Query},
-};
+use bevy_ecs::{bundle::Bundle, component::Component};
pub use data::*;
use derive_more::{Deref, DerefMut};
-pub use dimensions::{update_bounding_box, EntityDimensions};
-pub use info::{
- clamp_look_direction, EntityInfos, EntityPlugin, EntityUpdateSet, LoadedBy,
- RelativeEntityUpdate,
-};
+pub use dimensions::EntityDimensions;
use std::fmt::Debug;
use uuid::Uuid;
+pub use crate::plugin::*;
+
pub fn move_relative(
physics: &mut Physics,
direction: &LookDirection,
@@ -234,21 +225,6 @@ pub struct Physics {
#[derive(Component, Copy, Clone, Default)]
pub struct Dead;
-/// 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.
-///
-/// Entities that are dead can not be revived.
-/// TODO: fact check this in-game by setting an entity's health to 0 and then
-/// not 0
-pub fn add_dead(mut commands: Commands, query: Query<(Entity, &Health), Changed<Health>>) {
- for (entity, health) in query.iter() {
- if **health <= 0.0 {
- commands.entity(entity).insert(Dead);
- }
- }
-}
-
/// A component that contains the offset of the entity's eyes from the entity
/// coordinates.
///