From 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:14:36 -0600 Subject: 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 --- azalea/src/pathfinder/mod.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'azalea/src/pathfinder/mod.rs') 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::() .add_event::() - .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)) -- cgit v1.2.3