aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/lib.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-12-10 00:08:08 -0600
committerGitHub <noreply@github.com>2023-12-10 00:08:08 -0600
commit348c71b97b2dfc45d7412ec33f6131e20592bb14 (patch)
tree2490f6fe8e4d8181a526b66e0397ceea96ec8961 /azalea-entity/src/lib.rs
parentf15f0325c0a9d62f10ea22b891ab7134391b04fb (diff)
downloadazalea-drasl-348c71b97b2dfc45d7412ec33f6131e20592bb14.tar.xz
Climbing (#121)
* start implementing climbing * fix tests * fix bots running at lower tick rate
Diffstat (limited to 'azalea-entity/src/lib.rs')
-rw-r--r--azalea-entity/src/lib.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs
index bf3dfc82..eb5b5b25 100644
--- a/azalea-entity/src/lib.rs
+++ b/azalea-entity/src/lib.rs
@@ -116,8 +116,13 @@ pub fn on_pos(offset: f32, chunk_storage: &ChunkStorage, pos: &Position) -> Bloc
/// The Minecraft UUID of the entity. For players, this is their actual player
/// UUID, and for other entities it's just random.
-#[derive(Component, Deref, DerefMut, Clone, Copy)]
+#[derive(Component, Deref, DerefMut, Clone, Copy, Default)]
pub struct EntityUuid(Uuid);
+impl EntityUuid {
+ pub fn new(uuid: Uuid) -> Self {
+ Self(uuid)
+ }
+}
impl Debug for EntityUuid {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
(self.0).fmt(f)
@@ -228,6 +233,10 @@ pub struct Physics {
pub bounding_box: AABB,
pub has_impulse: bool,
+
+ pub horizontal_collision: bool,
+ // pub minor_horizontal_collision: bool,
+ pub vertical_collision: bool,
}
impl Physics {
@@ -246,6 +255,9 @@ impl Physics {
dimensions,
has_impulse: false,
+
+ horizontal_collision: false,
+ vertical_collision: false,
}
}
}
@@ -311,6 +323,7 @@ pub struct EntityBundle {
pub attributes: Attributes,
pub jumping: Jumping,
pub fluid_on_eyes: FluidOnEyes,
+ pub on_climbable: OnClimbable,
}
impl EntityBundle {
@@ -346,6 +359,7 @@ impl EntityBundle {
jumping: Jumping(false),
fluid_on_eyes: FluidOnEyes(azalea_registry::Fluid::Empty),
+ on_climbable: OnClimbable(false),
}
}
}
@@ -373,6 +387,9 @@ impl FluidOnEyes {
}
}
+#[derive(Component, Clone, Debug, PartialEq, Deref, DerefMut)]
+pub struct OnClimbable(bool);
+
// #[cfg(test)]
// mod tests {
// use super::*;