aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/packet
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-04 06:11:15 -1400
committermat <git@matdoes.dev>2025-04-04 18:24:22 -0200
commite99ae608b67ad3ff105666e619d04ca9385488e1 (patch)
tree2457aa38334ccc4a542d0fbf52ca09db39c31c0b /azalea-client/src/plugins/packet
parent1fd02925903cfe59e85977b5c27e49457d99b142 (diff)
downloadazalea-drasl-e99ae608b67ad3ff105666e619d04ca9385488e1.tar.xz
rename ChatPacket::username and uuid to sender and sender_uuid
also adds more convenience functions to Client
Diffstat (limited to 'azalea-client/src/plugins/packet')
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index ae1f3deb..8d896e65 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -744,7 +744,7 @@ impl GamePacketHandler<'_> {
)>(self.ecs, |(mut commands, query, entity_kind_query)| {
let (entity_id_index, instance_holder) = query.get(self.player).unwrap();
- let entity = entity_id_index.get(p.id);
+ let entity = entity_id_index.get_by_minecraft_entity(p.id);
let Some(entity) = entity else {
// some servers like hypixel trigger this a lot :(
@@ -803,7 +803,7 @@ impl GamePacketHandler<'_> {
|(mut commands, query)| {
let (entity_id_index, instance_holder) = query.get(self.player).unwrap();
- let Some(entity) = entity_id_index.get(p.id) else {
+ let Some(entity) = entity_id_index.get_by_minecraft_entity(p.id) else {
// note that this log (and some other ones like the one in RemoveEntities)
// sometimes happens when killing mobs. it seems to be a vanilla bug, which is
// why it's a debug log instead of a warning
@@ -876,7 +876,7 @@ impl GamePacketHandler<'_> {
|(mut commands, mut query)| {
let (entity_id_index, instance_holder) = query.get_mut(self.player).unwrap();
- let Some(entity) = entity_id_index.get(p.id) else {
+ let Some(entity) = entity_id_index.get_by_minecraft_entity(p.id) else {
warn!("Got teleport entity packet for unknown entity id {}", p.id);
return;
};
@@ -922,7 +922,7 @@ impl GamePacketHandler<'_> {
debug!("Got move entity pos packet {p:?}");
let entity_id = p.entity_id;
- let Some(entity) = entity_id_index.get(entity_id) else {
+ let Some(entity) = entity_id_index.get_by_minecraft_entity(entity_id) else {
debug!("Got move entity pos packet for unknown entity id {entity_id}");
return;
};
@@ -964,7 +964,7 @@ impl GamePacketHandler<'_> {
debug!("Got move entity pos rot packet {p:?}");
- let entity = entity_id_index.get(p.entity_id);
+ let entity = entity_id_index.get_by_minecraft_entity(p.entity_id);
let Some(entity) = entity else {
// often triggered by hypixel :(
@@ -1016,7 +1016,7 @@ impl GamePacketHandler<'_> {
|(mut commands, mut query)| {
let (entity_id_index, instance_holder) = query.get_mut(self.player).unwrap();
- let entity = entity_id_index.get(p.entity_id);
+ let entity = entity_id_index.get_by_minecraft_entity(p.entity_id);
if let Some(entity) = entity {
let new_look_direction = LookDirection {
x_rot: (p.x_rot as i32 * 360) as f32 / 256.,
@@ -1075,7 +1075,7 @@ impl GamePacketHandler<'_> {
};
for &id in &p.entity_ids {
- let Some(entity) = entity_id_index.remove(id) else {
+ let Some(entity) = entity_id_index.remove_by_minecraft_entity(id) else {
debug!(
"Tried to remove entity with id {id} but it wasn't in the EntityIdIndex. This may be expected on certain server setups (like if they're using VeryManyPlayers)."
);
@@ -1524,7 +1524,7 @@ impl GamePacketHandler<'_> {
|(mut commands, mut query)| {
let (entity_id_index, instance_holder) = query.get_mut(self.player).unwrap();
- let Some(entity) = entity_id_index.get(p.id) else {
+ let Some(entity) = entity_id_index.get_by_minecraft_entity(p.id) else {
debug!("Got teleport entity packet for unknown entity id {}", p.id);
return;
};