aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/packet
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-08-12 20:50:40 -1030
committermat <git@matdoes.dev>2025-08-12 20:50:40 -1030
commit55a7db13ef028f5b6c6e87a81406b3525cea196f (patch)
tree6a995bc0b46c527e9fab0874508f81e07deb673e /azalea-client/src/plugins/packet
parentac66744586880afd657969ae078700a9749e293a (diff)
downloadazalea-drasl-55a7db13ef028f5b6c6e87a81406b3525cea196f.tar.xz
send correct packets on teleport
Diffstat (limited to 'azalea-client/src/plugins/packet')
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs21
1 files changed, 4 insertions, 17 deletions
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index fe294ad0..26d83195 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -7,8 +7,8 @@ use azalea_core::{
position::{ChunkPos, Vec3},
};
use azalea_entity::{
- Dead, EntityBundle, EntityKindComponent, LastSentPosition, LoadedBy, LocalEntity,
- LookDirection, Physics, Position, RelativeEntityUpdate,
+ Dead, EntityBundle, EntityKindComponent, HasClientLoaded, LoadedBy, LocalEntity, LookDirection,
+ Physics, Position, RelativeEntityUpdate,
indexing::{EntityIdIndex, EntityUuidIndex},
metadata::{Health, apply_metadata},
};
@@ -33,7 +33,6 @@ use crate::{
inventory::{
ClientSideCloseContainerEvent, Inventory, MenuOpenedEvent, SetContainerContentEvent,
},
- loading::HasClientLoaded,
local_player::{Hunger, InstanceHolder, LocalGameMode, PlayerAbilities, TabList},
movement::{KnockbackEvent, KnockbackType},
packet::as_system,
@@ -409,22 +408,13 @@ impl GamePacketHandler<'_> {
debug!("Got player position packet {p:?}");
as_system::<(
- Query<(
- &mut Physics,
- &mut LookDirection,
- &mut Position,
- &mut LastSentPosition,
- )>,
+ Query<(&mut Physics, &mut LookDirection, &mut Position)>,
Commands,
)>(self.ecs, |(mut query, mut commands)| {
- let Ok((mut physics, mut direction, mut position, mut last_sent_position)) =
- query.get_mut(self.player)
- else {
+ let Ok((mut physics, mut direction, mut position)) = query.get_mut(self.player) else {
return;
};
- **last_sent_position = **position;
-
p.relative
.apply(&p.change, &mut position, &mut direction, &mut physics);
// old_pos is set to the current position when we're teleported
@@ -1500,9 +1490,6 @@ impl GamePacketHandler<'_> {
physics.set_on_ground(new_on_ground);
- let mut last_sent_position =
- entity_mut.get_mut::<LastSentPosition>().unwrap();
- **last_sent_position = new_position;
let mut position = entity_mut.get_mut::<Position>().unwrap();
**position = new_position;