From 348c71b97b2dfc45d7412ec33f6131e20592bb14 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sun, 10 Dec 2023 00:08:08 -0600 Subject: Climbing (#121) * start implementing climbing * fix tests * fix bots running at lower tick rate --- azalea-physics/src/collision/mod.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'azalea-physics/src/collision') diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs index 2c739b24..72151b6b 100644 --- a/azalea-physics/src/collision/mod.rs +++ b/azalea-physics/src/collision/mod.rs @@ -136,7 +136,7 @@ pub fn move_colliding( _mover_type: &MoverType, movement: &Vec3, world: &Instance, - mut position: Mut, + position: &mut Mut, physics: &mut azalea_entity::Physics, ) -> Result<(), MoveEntityError> { // TODO: do all these @@ -175,8 +175,8 @@ pub fn move_colliding( } }; - if new_pos != **position { - **position = new_pos; + if new_pos != ***position { + ***position = new_pos; } } @@ -185,11 +185,14 @@ pub fn move_colliding( let horizontal_collision = x_collision || z_collision; let vertical_collision = movement.y != collide_result.y; let on_ground = vertical_collision && movement.y < 0.; + + physics.horizontal_collision = horizontal_collision; + physics.vertical_collision = vertical_collision; physics.on_ground = on_ground; // TODO: minecraft checks for a "minor" horizontal collision here - let _block_pos_below = azalea_entity::on_pos_legacy(&world.chunks, &position); + let _block_pos_below = azalea_entity::on_pos_legacy(&world.chunks, position); // let _block_state_below = self // .world // .get_block_state(&block_pos_below) -- cgit v1.2.3