diff --git a/pumpkin/src/client/player_packet.rs b/pumpkin/src/client/player_packet.rs index 8d6e8ecbe..57d6313b1 100644 --- a/pumpkin/src/client/player_packet.rs +++ b/pumpkin/src/client/player_packet.rs @@ -422,13 +422,13 @@ impl Player { if config.knockback { let yaw = entity.yaw.load(); let strength = 1.0; - let victem_velocity = victem_entity.velocity.load(); - let saved_velo = victem_velocity; + let saved_velo = victem_entity.velocity.load(); victem_entity.knockback( strength * 0.5, (yaw * (PI / 180.0)).sin() as f64, -(yaw * (PI / 180.0)).cos() as f64, ); + let victem_velocity = victem_entity.velocity.load(); let packet = &CEntityVelocity::new( &entity_id, victem_velocity.x as f32, @@ -436,7 +436,7 @@ impl Player { victem_velocity.z as f32, ); let velocity = entity.velocity.load(); - victem_entity + entity .velocity .store(velocity.multiply(0.6, 1.0, 0.6)); diff --git a/pumpkin/src/world/player_chunker.rs b/pumpkin/src/world/player_chunker.rs index 2ef29d65d..3e17def7f 100644 --- a/pumpkin/src/world/player_chunker.rs +++ b/pumpkin/src/world/player_chunker.rs @@ -112,9 +112,6 @@ pub async fn update_position(player: &Player) { }, |chunk_pos| { unloading_chunks.push(chunk_pos); - // player - // .client - // .send_packet(&CUnloadChunk::new(chunk_pos.x, chunk_pos.z)); }, false, ); @@ -131,6 +128,7 @@ pub async fn update_position(player: &Player) { .world .mark_chunks_as_not_watched(&unloading_chunks) .await; + // we may don't need to iter twice for chunk in unloading_chunks { if !player .client