Skip to content

Commit

Permalink
rename KnockbackEvent::kind to knockback
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Oct 13, 2023
1 parent eeec59a commit 97ec9f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions azalea-client/src/movement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ fn has_enough_impulse_to_start_sprinting(physics_state: &PhysicsState) -> bool {
#[derive(Event)]
pub struct KnockbackEvent {
pub entity: Entity,
pub kind: KnockbackType,
pub knockback: KnockbackType,
}

pub enum KnockbackType {
Expand All @@ -488,7 +488,7 @@ pub enum KnockbackType {
pub fn handle_knockback(mut query: Query<&mut Physics>, mut events: EventReader<KnockbackEvent>) {
for event in events.iter() {
if let Ok(mut physics) = query.get_mut(event.entity) {
match event.kind {
match event.knockback {
KnockbackType::Set(velocity) => {
physics.velocity = velocity;
}
Expand Down
4 changes: 2 additions & 2 deletions azalea-client/src/packet_handling/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ pub fn process_packet_events(ecs: &mut World) {
entity_mut.world_scope(|world| {
world.send_event(KnockbackEvent {
entity,
kind: KnockbackType::Set(Vec3 {
knockback: KnockbackType::Set(Vec3 {
x: p.xa as f64 / 8000.,
y: p.ya as f64 / 8000.,
z: p.za as f64 / 8000.,
Expand Down Expand Up @@ -1199,7 +1199,7 @@ pub fn process_packet_events(ecs: &mut World) {

knockback_events.send(KnockbackEvent {
entity: player_entity,
kind: KnockbackType::Set(Vec3 {
knockback: KnockbackType::Set(Vec3 {
x: p.knockback_x as f64,
y: p.knockback_y as f64,
z: p.knockback_z as f64,
Expand Down

0 comments on commit 97ec9f7

Please sign in to comment.