diff options
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/client.rs | 4 | ||||
| -rw-r--r-- | azalea-client/src/ping.rs | 7 | ||||
| -rw-r--r-- | azalea-client/src/plugins/inventory.rs | 2 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/config/mod.rs | 3 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/game/mod.rs | 3 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/login/mod.rs | 4 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/mod.rs | 6 |
7 files changed, 15 insertions, 14 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 98d8a3d3..2ec25dcc 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -64,13 +64,13 @@ use crate::{ player::{GameProfileComponent, PlayerInfo, retroactively_add_game_profile_component}, }; -/// `Client` has the things that a user interacting with the library will want. +/// A Minecraft client instance that can interact with the world. /// /// To make a new client, use either [`azalea::ClientBuilder`] or /// [`Client::join`]. /// /// Note that `Client` is inaccessible from systems (i.e. plugins), but you can -/// achieve everything that client can do with events. +/// achieve everything that client can do with ECS events. /// /// [`azalea::ClientBuilder`]: https://docs.rs/azalea/latest/azalea/struct.ClientBuilder.html #[derive(Clone)] diff --git a/azalea-client/src/ping.rs b/azalea-client/src/ping.rs index 38d5c26f..8c4e2240 100644 --- a/azalea-client/src/ping.rs +++ b/azalea-client/src/ping.rs @@ -67,9 +67,10 @@ pub async fn ping_server_with_proxy( ping_server_with_connection(address, conn).await } -/// Ping a Minecraft server after we've already created a [`Connection`]. The -/// `Connection` must still be in the handshake state (which is the state it's -/// in immediately after it's created). +/// Ping a Minecraft server after we've already created a [`Connection`]. +/// +/// The `Connection` must still be in the handshake state (which is the state +/// it's in immediately after it's created). pub async fn ping_server_with_connection( address: ServerAddress, mut conn: Connection<ClientboundHandshakePacket, ServerboundHandshakePacket>, diff --git a/azalea-client/src/plugins/inventory.rs b/azalea-client/src/plugins/inventory.rs index e6481577..968a805b 100644 --- a/azalea-client/src/plugins/inventory.rs +++ b/azalea-client/src/plugins/inventory.rs @@ -734,7 +734,7 @@ impl Default for Inventory { /// chest or crafting table). /// /// To watch for the menu being closed, you could use -/// [`ClientSideCloseContainerEvent`]. To close it manually, use +/// [`ClientsideCloseContainerEvent`]. To close it manually, use /// [`CloseContainerEvent`]. #[derive(Event, Debug, Clone)] pub struct MenuOpenedEvent { diff --git a/azalea-client/src/plugins/packet/config/mod.rs b/azalea-client/src/plugins/packet/config/mod.rs index 3116e245..416019e8 100644 --- a/azalea-client/src/plugins/packet/config/mod.rs +++ b/azalea-client/src/plugins/packet/config/mod.rs @@ -11,11 +11,10 @@ use bevy_ecs::prelude::*; pub use events::*; use tracing::{debug, warn}; -use super::as_system; +use super::{as_system, declare_packet_handlers}; use crate::{ client::InConfigState, connection::RawConnection, - declare_packet_handlers, disconnect::DisconnectEvent, local_player::InstanceHolder, packet::game::{KeepAliveEvent, ResourcePackEvent}, diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index bc1d1752..fc8f34cf 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -27,7 +27,6 @@ use crate::{ chat::{ChatPacket, ChatReceivedEvent}, chunks, connection::RawConnection, - declare_packet_handlers, disconnect::DisconnectEvent, interact::BlockStatePredictionHandler, inventory::{ @@ -35,7 +34,7 @@ use crate::{ }, local_player::{Hunger, InstanceHolder, LocalGameMode, TabList}, movement::{KnockbackEvent, KnockbackType}, - packet::as_system, + packet::{as_system, declare_packet_handlers}, player::{GameProfileComponent, PlayerInfo}, tick_counter::TicksConnected, }; diff --git a/azalea-client/src/plugins/packet/login/mod.rs b/azalea-client/src/plugins/packet/login/mod.rs index 99ebae9b..03e87920 100644 --- a/azalea-client/src/plugins/packet/login/mod.rs +++ b/azalea-client/src/plugins/packet/login/mod.rs @@ -17,8 +17,8 @@ use tracing::{debug, error}; use super::as_system; use crate::{ - Account, InConfigState, connection::RawConnection, declare_packet_handlers, - disconnect::DisconnectEvent, player::GameProfileComponent, + Account, InConfigState, connection::RawConnection, disconnect::DisconnectEvent, + packet::declare_packet_handlers, player::GameProfileComponent, }; pub fn process_packet(ecs: &mut World, player: Entity, packet: &ClientboundLoginPacket) { diff --git a/azalea-client/src/plugins/packet/mod.rs b/azalea-client/src/plugins/packet/mod.rs index c8eff7d6..2602e878 100644 --- a/azalea-client/src/plugins/packet/mod.rs +++ b/azalea-client/src/plugins/packet/mod.rs @@ -65,8 +65,8 @@ impl Plugin for PacketPlugin { } } -#[macro_export] -macro_rules! declare_packet_handlers { +#[doc(hidden)] +macro_rules! __declare_packet_handlers { ( $packetenum:ident, $packetvar:expr, @@ -83,6 +83,8 @@ macro_rules! declare_packet_handlers { }; } +pub(crate) use __declare_packet_handlers as declare_packet_handlers; + pub(crate) fn as_system<T>(ecs: &mut World, f: impl FnOnce(T::Item<'_, '_>)) where T: SystemParam + 'static, |
