diff options
| author | mat <github@matdoes.dev> | 2023-03-11 17:02:57 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2023-03-11 17:02:57 -0600 |
| commit | cd0a1ed8d4c7670eb58d33f521026e760798e1a5 (patch) | |
| tree | 5b47c3ab6ffa3cd2b87b26a24bfb854a53885fc4 /azalea-client/src/client.rs | |
| parent | 40a0c8acfbfb88be791c295a14014468e2fd4298 (diff) | |
| download | azalea-drasl-cd0a1ed8d4c7670eb58d33f521026e760798e1a5.tar.xz | |
fix doc errors
Diffstat (limited to 'azalea-client/src/client.rs')
| -rw-r--r-- | azalea-client/src/client.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 8f460da8..47cc7235 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -38,7 +38,7 @@ use azalea_protocol::{ }; use azalea_world::{ entity::{EntityPlugin, EntityUpdateSet, Local, WorldName}, - Instance, PartialWorld, WorldContainer, + Instance, InstanceContainer, PartialInstance, }; use bevy_app::{App, CoreSchedule, Plugin, PluginGroup, PluginGroupBuilder}; use bevy_ecs::{ @@ -75,13 +75,13 @@ pub struct Client { /// and skin data. /// /// This is immutable; the server cannot change it. To get the username and - /// skin the server chose for you, get your player from - /// [`Self::players`]. + /// skin the server chose for you, get your player from the [`TabList`] + /// component. pub profile: GameProfile, /// The entity for this client in the ECS. pub entity: Entity, /// The world that this client is in. - pub world: Arc<RwLock<PartialWorld>>, + pub world: Arc<RwLock<PartialInstance>>, /// The entity component system. You probably don't need to access this /// directly. Note that if you're using a shared world (i.e. a swarm), this @@ -94,8 +94,7 @@ pub struct Client { /// A component that contains some of the "settings" for this client that are /// sent to the server, such as render distance. -#[derive(Component, Clone, Debug, Deref, DerefMut, Default, Eq, PartialEq)] -pub struct ClientInformation(ServerboundClientInformationPacket); +pub type ClientInformation = ServerboundClientInformationPacket; /// A component that contains a map of player UUIDs to their information in the /// tab list @@ -137,7 +136,7 @@ impl Client { profile, // default our id to 0, it'll be set later entity, - world: Arc::new(RwLock::new(PartialWorld::default())), + world: Arc::new(RwLock::new(PartialInstance::default())), ecs, @@ -424,14 +423,14 @@ impl Client { /// Get a reference to our (potentially shared) world. /// - /// This gets the [`World`] from our world container. If it's a normal + /// This gets the [`Instance`] from our world container. If it's a normal /// client, then it'll be the same as the world the client has loaded. /// If the client using a shared world, then the shared world will be a /// superset of the client's world. pub fn world(&self) -> Arc<RwLock<Instance>> { let world_name = self.component::<WorldName>(); let ecs = self.ecs.lock(); - let world_container = ecs.resource::<WorldContainer>(); + let world_container = ecs.resource::<InstanceContainer>(); world_container.get(&world_name).unwrap() } @@ -464,7 +463,7 @@ impl Client { { let mut ecs = self.ecs.lock(); let mut client_information_mut = self.query::<&mut ClientInformation>(&mut ecs); - **client_information_mut = client_information.clone(); + *client_information_mut = client_information.clone(); } if self.logged_in() { @@ -514,7 +513,7 @@ impl Plugin for AzaleaPlugin { app.add_event::<SendPacketEvent>() .add_system(handle_send_packet_event); - app.init_resource::<WorldContainer>(); + app.init_resource::<InstanceContainer>(); } } |
