diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-03-07 14:14:36 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 14:14:36 -0600 |
| commit | 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b (patch) | |
| tree | ce5d6c62bc36fb1d1ec31083bc8e81a0109c12df /azalea/src/pathfinder/mod.rs | |
| parent | bf4ff517890cad3ff4e36b4b78959504192e5374 (diff) | |
| download | azalea-drasl-719379a8a76ab0685f2bd14bebe2f0cd1e97f06b.tar.xz | |
Bevy 0.10 (#79)
* replace 0.9.1 with 0.10.0
* start migrating to bevy .10
* well it compiles
* doesn't immediately panic
* remove unused imports
* fmt
* delete azalea-ecs
* make RelativeEntityUpdate an EntityCommand
* fix a doc test
* explain what FixedUpdate does
Diffstat (limited to 'azalea/src/pathfinder/mod.rs')
| -rw-r--r-- | azalea/src/pathfinder/mod.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index 8289d9c4..61a92038 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -4,18 +4,18 @@ mod mtdstarlite; use crate::bot::{JumpEvent, LookAtEvent}; use crate::{SprintDirection, WalkDirection}; -use azalea_client::{StartSprintEvent, StartWalkEvent}; -use azalea_core::{BlockPos, CardinalDirection}; -use azalea_ecs::{ - app::{App, Plugin}, +use crate::app::{App, CoreSchedule, IntoSystemAppConfig, Plugin}; +use crate::ecs::{ component::Component, entity::Entity, event::{EventReader, EventWriter}, query::{With, Without}, - schedule::IntoSystemDescriptor, + schedule::IntoSystemConfig, system::{Commands, Query, Res}, - AppTickExt, }; +use azalea_client::{StartSprintEvent, StartWalkEvent}; +use azalea_core::{BlockPos, CardinalDirection}; +use azalea_physics::PhysicsSet; use azalea_world::entity::metadata::Player; use azalea_world::entity::Local; use azalea_world::{ @@ -36,7 +36,13 @@ impl Plugin for PathfinderPlugin { fn build(&self, app: &mut App) { app.add_event::<GotoEvent>() .add_event::<PathFoundEvent>() - .add_tick_system(tick_execute_path.before("ai_step")) + .add_system( + // Adding `.in_schedule(CoreSchedule::FixedUpdate)` makes a system run every + // Minecraft tick (every 50 milliseconds). + tick_execute_path + .in_schedule(CoreSchedule::FixedUpdate) + .before(PhysicsSet), + ) .add_system(goto_listener) .add_system(add_default_pathfinder) .add_system(handle_tasks.before(path_found_listener)) |
