aboutsummaryrefslogtreecommitdiff
path: root/azalea-client
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client')
-rw-r--r--azalea-client/src/packet_handling.rs13
-rwxr-xr-xazalea-client/src/player.rs6
2 files changed, 9 insertions, 10 deletions
diff --git a/azalea-client/src/packet_handling.rs b/azalea-client/src/packet_handling.rs
index 547b1b4b..d72a06b2 100644
--- a/azalea-client/src/packet_handling.rs
+++ b/azalea-client/src/packet_handling.rs
@@ -2,9 +2,10 @@ use std::{collections::HashSet, io::Cursor, sync::Arc};
use azalea_core::{ChunkPos, GameMode, ResourceLocation, Vec3};
use azalea_entity::{
+ indexing::EntityUuidIndex,
metadata::{apply_metadata, Health, PlayerMetadataBundle},
- Dead, EntityBundle, EntityInfos, EntityKind, EntityUpdateSet, LastSentPosition, LoadedBy,
- LookDirection, Physics, PlayerBundle, Position, RelativeEntityUpdate,
+ Dead, EntityBundle, EntityKind, EntityUpdateSet, LastSentPosition, LoadedBy, LookDirection,
+ Physics, PlayerBundle, Position, RelativeEntityUpdate,
};
use azalea_protocol::{
connect::{ReadConnection, WriteConnection},
@@ -579,9 +580,9 @@ fn process_packet_events(ecs: &mut World) {
Commands,
Query<Option<&InstanceName>>,
Res<InstanceContainer>,
- ResMut<EntityInfos>,
+ ResMut<EntityUuidIndex>,
)> = SystemState::new(ecs);
- let (mut commands, mut query, instance_container, mut entity_infos) =
+ let (mut commands, mut query, instance_container, mut entity_uuid_index) =
system_state.get_mut(ecs);
let instance_name = query.get_mut(player_entity).unwrap();
@@ -601,9 +602,7 @@ fn process_packet_events(ecs: &mut World) {
.write()
.entity_by_id
.insert(MinecraftEntityId(p.id), entity_commands.id());
- entity_infos
- .entity_by_uuid
- .insert(p.uuid, entity_commands.id());
+ entity_uuid_index.insert(p.uuid, entity_commands.id());
}
// the bundle doesn't include the default entity metadata so we add that
diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs
index 25ba0d8c..a94340ab 100755
--- a/azalea-client/src/player.rs
+++ b/azalea-client/src/player.rs
@@ -1,7 +1,7 @@
use azalea_auth::game_profile::GameProfile;
use azalea_chat::FormattedText;
use azalea_core::GameMode;
-use azalea_entity::EntityInfos;
+use azalea_entity::indexing::EntityUuidIndex;
use bevy_ecs::{
event::EventReader,
system::{Commands, Res},
@@ -35,10 +35,10 @@ pub struct PlayerInfo {
pub fn retroactively_add_game_profile_component(
mut commands: Commands,
mut events: EventReader<AddPlayerEvent>,
- entity_infos: Res<EntityInfos>,
+ entity_uuid_index: Res<EntityUuidIndex>,
) {
for event in events.iter() {
- if let Some(entity) = entity_infos.get_entity_by_uuid(&event.info.uuid) {
+ if let Some(entity) = entity_uuid_index.get(&event.info.uuid) {
commands
.entity(entity)
.insert(GameProfileComponent(event.info.profile.clone()));