diff options
| author | mat <git@matdoes.dev> | 2023-09-14 18:29:28 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-09-14 18:29:28 -0500 |
| commit | 90d6b0acea7183d1a3b05d9a92825fa30b02c1cc (patch) | |
| tree | 59284960afcd1898fc3d84632e998383a6ef3114 | |
| parent | 6a37971420e1fcf2d48d68281d99e0d464297687 (diff) | |
| download | azalea-drasl-90d6b0acea7183d1a3b05d9a92825fa30b02c1cc.tar.xz | |
fix unknown entity warnings
| -rw-r--r-- | azalea-client/src/packet_handling.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/azalea-client/src/packet_handling.rs b/azalea-client/src/packet_handling.rs index ca96d728..de88665e 100644 --- a/azalea-client/src/packet_handling.rs +++ b/azalea-client/src/packet_handling.rs @@ -220,11 +220,16 @@ pub fn process_packet_events(ecs: &mut World) { #[allow(clippy::type_complexity)] let mut system_state: SystemState<( Commands, - Query<(&mut LocalPlayer, &GameProfileComponent, &ClientInformation)>, + Query<( + &mut LocalPlayer, + &mut EntityIdIndex, + &GameProfileComponent, + &ClientInformation, + )>, ResMut<InstanceContainer>, )> = SystemState::new(ecs); let (mut commands, mut query, mut instance_container) = system_state.get_mut(ecs); - let (mut local_player, game_profile, client_information) = + let (mut local_player, mut entity_id_index, game_profile, client_information) = query.get_mut(player_entity).unwrap(); { @@ -283,6 +288,9 @@ pub fn process_packet_events(ecs: &mut World) { received_registries, player_bundle, )); + + // add our own player to our index + entity_id_index.insert(MinecraftEntityId(p.player_id), player_entity); } // brand @@ -579,7 +587,7 @@ pub fn process_packet_events(ecs: &mut World) { } } ClientboundGamePacket::AddEntity(p) => { - debug!("Got add entity packet {:?}", p); + debug!("Got add entity packet {p:?}"); #[allow(clippy::type_complexity)] let mut system_state: SystemState<( @@ -657,10 +665,10 @@ pub fn process_packet_events(ecs: &mut World) { // debug!("Got entity velocity packet {:?}", p); } ClientboundGamePacket::SetEntityLink(p) => { - debug!("Got set entity link packet {:?}", p); + debug!("Got set entity link packet {p:?}"); } ClientboundGamePacket::AddPlayer(p) => { - debug!("Got add player packet {:?}", p); + debug!("Got add player packet {p:?}"); #[allow(clippy::type_complexity)] let mut system_state: SystemState<( |
