1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

switch some packet structs to unit structs

This commit is contained in:
mat 2024-11-28 20:33:39 +00:00
parent ae5c0ea8e5
commit f364ad6b21
12 changed files with 18 additions and 21 deletions

View file

@ -61,6 +61,7 @@ pub struct WriteConnection<W: ProtocolPacket> {
/// resolver, /// resolver,
/// connect::Connection, /// connect::Connection,
/// packets::{ /// packets::{
/// self,
/// ClientIntention, PROTOCOL_VERSION, /// ClientIntention, PROTOCOL_VERSION,
/// login::{ /// login::{
/// ClientboundLoginPacket, /// ClientboundLoginPacket,
@ -115,7 +116,13 @@ pub struct WriteConnection<W: ProtocolPacket> {
/// return Err("login disconnect".into()); /// return Err("login disconnect".into());
/// } /// }
/// ClientboundLoginPacket::CustomQuery(p) => {} /// ClientboundLoginPacket::CustomQuery(p) => {}
/// ClientboundLoginPacket::CookieRequest(_) => {} /// ClientboundLoginPacket::CookieRequest(p) => {
/// conn.write(packets::login::ServerboundCookieResponse {
/// key: p.key,
/// payload: None,
/// })
/// .await?;
/// }
/// } /// }
/// }; /// };
/// ///

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket; use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] #[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundFinishConfiguration {} pub struct ClientboundFinishConfiguration;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket; use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] #[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundFinishConfiguration {} pub struct ServerboundFinishConfiguration;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket; use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundChunkBatchStart {} pub struct ClientboundChunkBatchStart;

View file

@ -88,16 +88,6 @@ pub struct MessageSignatureCache {
pub entries: Vec<Option<MessageSignature>>, pub entries: Vec<Option<MessageSignature>>,
} }
// impl MessageSignatureCache {
// pub fn unpacker(&self) -> impl Fn(u32) -> Option<SignedMessageBody> {
// }
// }
// impl PackedSignedMessageBody {
// pub fn unpack(&self, unpacker: impl Fn(u32) -> Option<SignedMessageBody>)
// {} }
impl ClientboundPlayerChat { impl ClientboundPlayerChat {
/// Returns the content of the message. If you want to get the FormattedText /// Returns the content of the message. If you want to get the FormattedText
/// for the whole message including the sender part, use /// for the whole message including the sender part, use

View file

@ -3,4 +3,4 @@ use azalea_protocol_macros::ClientboundGamePacket;
/// Unused in vanilla. /// Unused in vanilla.
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundPlayerCombatEnter {} pub struct ClientboundPlayerCombatEnter;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket; use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundStartConfiguration {} pub struct ClientboundStartConfiguration;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundGamePacket; use azalea_protocol_macros::ServerboundGamePacket;
#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] #[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
pub struct ServerboundClientTickEnd {} pub struct ServerboundClientTickEnd;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundGamePacket; use azalea_protocol_macros::ServerboundGamePacket;
#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] #[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
pub struct ServerboundConfigurationAcknowledged {} pub struct ServerboundConfigurationAcknowledged;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundLoginPacket; use azalea_protocol_macros::ServerboundLoginPacket;
#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] #[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)]
pub struct ServerboundLoginAcknowledged {} pub struct ServerboundLoginAcknowledged;

View file

@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundStatusPacket; use azalea_protocol_macros::ServerboundStatusPacket;
#[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)] #[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)]
pub struct ServerboundStatusRequest {} pub struct ServerboundStatusRequest;

View file

@ -2,7 +2,7 @@ use azalea_block::{Block, BlockState};
use azalea_client::{inventory::Inventory, Client}; use azalea_client::{inventory::Inventory, Client};
use azalea_entity::{FluidOnEyes, Physics}; use azalea_entity::{FluidOnEyes, Physics};
use azalea_inventory::{components, ItemStack, Menu}; use azalea_inventory::{components, ItemStack, Menu};
use azalea_registry::{DataComponentKind, Fluid}; use azalea_registry::Fluid;
#[derive(Debug)] #[derive(Debug)]
pub struct BestToolResult { pub struct BestToolResult {