diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-01-10 16:45:27 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-10 16:45:27 -0600 |
| commit | 0d16f01571ec8315f3979eae46981e559ade1cf9 (patch) | |
| tree | ea43c32a57b0e6a67579d75a134dfbc009d09781 /azalea-client/src/packet_handling | |
| parent | 615d8f9d2ac56b3244d328587243301da253eafd (diff) | |
| download | azalea-drasl-0d16f01571ec8315f3979eae46981e559ade1cf9.tar.xz | |
Fluid physics (#199)
* start implementing fluid physics
* Initial implementation of fluid pushing
* different travel function in water
* bubble columns
* jumping in water
* cleanup
* change ultrawarm to be required
* fix for clippy
Diffstat (limited to 'azalea-client/src/packet_handling')
| -rw-r--r-- | azalea-client/src/packet_handling/game.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index d92f2464..0d5a6afe 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -500,6 +500,9 @@ pub fn process_packet_events(ecs: &mut World) { **position = new_pos; } + // old_pos is set to the current position when we're teleported + physics.set_old_pos(&position); + // send the relevant packets send_packet_events.send(SendPacketEvent::new( @@ -853,10 +856,14 @@ pub fn process_packet_events(ecs: &mut World) { if new_pos != **position { **position = new_pos; } + let position = *position; let mut look_direction = entity.get_mut::<LookDirection>().unwrap(); if new_look_direction != *look_direction { *look_direction = new_look_direction; } + // old_pos is set to the current position when we're teleported + let mut physics = entity.get_mut::<Physics>().unwrap(); + physics.set_old_pos(&position); }), }); |
