aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/client.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-09-18 23:25:18 -0500
committermat <git@matdoes.dev>2023-09-18 23:25:22 -0500
commit51963990bc0cbbbca388b2ed015fd64ff6492d7b (patch)
treea06f6b78f6f3954c230a9c57050467bb20ebe232 /azalea-client/src/client.rs
parente6941b6a24deed617d09c6e08ba65278bb3bcf25 (diff)
downloadazalea-drasl-51963990bc0cbbbca388b2ed015fd64ff6492d7b.tar.xz
fix entities not always being despawned after merge
Diffstat (limited to 'azalea-client/src/client.rs')
-rw-r--r--azalea-client/src/client.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 6b2dba57..d5f40678 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -141,8 +141,12 @@ impl From<ClientboundPlayerAbilitiesPacket> for PlayerAbilities {
#[derive(Component, Clone, Default, Deref, DerefMut)]
pub struct PermissionLevel(pub u8);
-/// A component that contains a map of player UUIDs to their information in the
-/// tab list.
+/// A component and resource that contains a map of player UUIDs to their
+/// information in the tab list.
+///
+/// This is a component on local players in case you want to get the tab list
+/// that a certain client is seeing, and it's also a resource in case you know
+/// that the server gives the same tab list to every player.
///
/// ```
/// # use azalea_client::TabList;
@@ -153,7 +157,7 @@ pub struct PermissionLevel(pub u8);
/// println!("- {} ({}ms)", player_info.profile.name, player_info.latency);
/// }
/// # }
-#[derive(Component, Clone, Debug, Deref, DerefMut, Default)]
+#[derive(Component, Resource, Clone, Debug, Deref, DerefMut, Default)]
pub struct TabList(HashMap<Uuid, PlayerInfo>);
/// An error that happened while joining the server.
@@ -648,7 +652,8 @@ impl Plugin for AzaleaPlugin {
),
)
.add_event::<SendPacketEvent>()
- .init_resource::<InstanceContainer>();
+ .init_resource::<InstanceContainer>()
+ .init_resource::<TabList>();
}
}