aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-10-12 22:39:29 -0500
committermat <git@matdoes.dev>2023-10-12 22:39:29 -0500
commiteeec59adabb8c084c8b6b847a31130eb7c37d2ee (patch)
tree6ffa8e6d83ba5d6095062abf06406edf7f10d276 /azalea/src
parent79ad1e93bf6ce2b7c2da6925a7c85b33bb76f154 (diff)
downloadazalea-drasl-eeec59adabb8c084c8b6b847a31130eb7c37d2ee.tar.xz
KnockbackEvent and rename Physics::delta to velocity
Diffstat (limited to 'azalea/src')
-rw-r--r--azalea/src/auto_tool.rs2
-rw-r--r--azalea/src/pathfinder/mod.rs8
-rw-r--r--azalea/src/pathfinder/moves/basic.rs2
3 files changed, 6 insertions, 6 deletions
diff --git a/azalea/src/auto_tool.rs b/azalea/src/auto_tool.rs
index d7501f04..55ec6924 100644
--- a/azalea/src/auto_tool.rs
+++ b/azalea/src/auto_tool.rs
@@ -35,7 +35,7 @@ pub fn best_tool_in_hotbar_for_block(block: BlockState, menu: &Menu) -> BestTool
menu,
&Physics {
on_ground: true,
- delta: Default::default(),
+ velocity: Default::default(),
xxa: Default::default(),
yya: Default::default(),
zza: Default::default(),
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 73ce2967..e82b0179 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -25,7 +25,7 @@ use crate::pathfinder::moves::PathfinderCtx;
use crate::pathfinder::world::CachedWorld;
use azalea_client::chat::SendChatEvent;
use azalea_client::inventory::{InventoryComponent, InventorySet};
-use azalea_client::movement::walk_listener;
+use azalea_client::movement::MoveEventsSet;
use azalea_client::{StartSprintEvent, StartWalkEvent};
use azalea_core::position::{BlockPos, Vec3};
use azalea_entity::metadata::Player;
@@ -85,7 +85,7 @@ impl Plugin for PathfinderPlugin {
handle_stop_pathfinding_event,
)
.chain()
- .before(walk_listener)
+ .before(MoveEventsSet)
.before(InventorySet),
);
}
@@ -462,8 +462,8 @@ fn check_node_reached(
&& BlockPos::from(position) == movement.target
// adding the delta like this isn't a perfect solution but it helps to make
// sure we don't keep going if our delta is high
- && (x_difference_from_center + physics.delta.x).abs() < 0.2
- && (z_difference_from_center + physics.delta.z).abs() < 0.2
+ && (x_difference_from_center + physics.velocity.x).abs() < 0.2
+ && (z_difference_from_center + physics.velocity.z).abs() < 0.2
} else {
true
};
diff --git a/azalea/src/pathfinder/moves/basic.rs b/azalea/src/pathfinder/moves/basic.rs
index 4780798c..957e24c6 100644
--- a/azalea/src/pathfinder/moves/basic.rs
+++ b/azalea/src/pathfinder/moves/basic.rs
@@ -97,7 +97,7 @@ fn execute_ascend_move(mut ctx: ExecuteCtx) {
let side_distance = z_axis as f64 * (target_center.x - position.x).abs()
+ x_axis as f64 * (target_center.z - position.z).abs();
- let lateral_motion = x_axis as f64 * physics.delta.z + z_axis as f64 * physics.delta.x;
+ let lateral_motion = x_axis as f64 * physics.velocity.z + z_axis as f64 * physics.velocity.x;
if lateral_motion > 0.1 {
return;
}