diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-07-09 19:11:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-09 19:11:29 -0500 |
| commit | d1afd02aa84e7b4450c1607277f078eb2a0f1bf3 (patch) | |
| tree | efea9bb7ef7f2064f7c963fd88f394fecec6231b /azalea-client/src/movement.rs | |
| parent | ea8a8fccb6eb39c97f6cb69e11db5f7d0886172e (diff) | |
| download | azalea-drasl-d1afd02aa84e7b4450c1607277f078eb2a0f1bf3.tar.xz | |
Update to Bevy 0.11 (#94)
* update to bevy 0.11
* clippy
---------
Co-authored-by: mat <git@matdoes.dev>
Diffstat (limited to 'azalea-client/src/movement.rs')
| -rw-r--r-- | azalea-client/src/movement.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/azalea-client/src/movement.rs b/azalea-client/src/movement.rs index d68be8b8..2db392b4 100644 --- a/azalea-client/src/movement.rs +++ b/azalea-client/src/movement.rs @@ -14,14 +14,11 @@ use azalea_world::{ entity::{self, metadata::Sprinting, Attributes, Jumping, MinecraftEntityId}, MoveEntityError, }; -use bevy_app::{App, CoreSchedule, IntoSystemAppConfigs, Plugin}; +use bevy_app::{App, FixedUpdate, Plugin, Update}; +use bevy_ecs::prelude::Event; use bevy_ecs::{ - component::Component, - entity::Entity, - event::EventReader, - query::With, - schedule::{IntoSystemConfig, IntoSystemConfigs}, - system::Query, + component::Component, entity::Entity, event::EventReader, query::With, + schedule::IntoSystemConfigs, system::Query, }; use std::backtrace::Backtrace; use thiserror::Error; @@ -51,17 +48,18 @@ impl Plugin for PlayerMovePlugin { app.add_event::<StartWalkEvent>() .add_event::<StartSprintEvent>() .add_systems( + Update, (sprint_listener, walk_listener) .chain() .before(force_jump_listener), ) .add_systems( + FixedUpdate, ( local_player_ai_step.in_set(PhysicsSet), send_position.after(update_in_loaded_chunk), ) - .chain() - .in_schedule(CoreSchedule::FixedUpdate), + .chain(), ); } } @@ -379,6 +377,7 @@ impl Client { /// An event sent when the client starts walking. This does not get sent for /// non-local entities. +#[derive(Event)] pub struct StartWalkEvent { pub entity: Entity, pub direction: WalkDirection, @@ -402,6 +401,7 @@ pub fn walk_listener( /// An event sent when the client starts sprinting. This does not get sent for /// non-local entities. +#[derive(Event)] pub struct StartSprintEvent { pub entity: Entity, pub direction: SprintDirection, |
