From 0d16f01571ec8315f3979eae46981e559ade1cf9 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:45:27 -0600 Subject: 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 --- azalea-client/src/packet_handling/game.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'azalea-client/src/packet_handling') 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::().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::().unwrap(); + physics.set_old_pos(&position); }), }); -- cgit v1.2.3