Skip to content

Commit

Permalink
switch some packet structs to unit structs
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Nov 28, 2024
1 parent ae5c0ea commit f364ad6
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 21 deletions.
9 changes: 8 additions & 1 deletion azalea-protocol/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub struct WriteConnection<W: ProtocolPacket> {
/// resolver,
/// connect::Connection,
/// packets::{
/// self,
/// ClientIntention, PROTOCOL_VERSION,
/// login::{
/// ClientboundLoginPacket,
Expand Down Expand Up @@ -115,7 +116,13 @@ pub struct WriteConnection<W: ProtocolPacket> {
/// return Err("login disconnect".into());
/// }
/// ClientboundLoginPacket::CustomQuery(p) => {}
/// ClientboundLoginPacket::CookieRequest(_) => {}
/// ClientboundLoginPacket::CookieRequest(p) => {
/// conn.write(packets::login::ServerboundCookieResponse {
/// key: p.key,
/// payload: None,
/// })
/// .await?;
/// }
/// }
/// };
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;

#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundFinishConfiguration {}
pub struct ClientboundFinishConfiguration;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket;

#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundFinishConfiguration {}
pub struct ServerboundFinishConfiguration;
2 changes: 1 addition & 1 deletion azalea-protocol/src/packets/game/c_chunk_batch_start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;

#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundChunkBatchStart {}
pub struct ClientboundChunkBatchStart;
10 changes: 0 additions & 10 deletions azalea-protocol/src/packets/game/c_player_chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ pub struct MessageSignatureCache {
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 {
/// Returns the content of the message. If you want to get the FormattedText
/// for the whole message including the sender part, use
Expand Down
2 changes: 1 addition & 1 deletion azalea-protocol/src/packets/game/c_player_combat_enter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ use azalea_protocol_macros::ClientboundGamePacket;

/// Unused in vanilla.
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundPlayerCombatEnter {}
pub struct ClientboundPlayerCombatEnter;
2 changes: 1 addition & 1 deletion azalea-protocol/src/packets/game/c_start_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;

#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundStartConfiguration {}
pub struct ClientboundStartConfiguration;
2 changes: 1 addition & 1 deletion azalea-protocol/src/packets/game/s_client_tick_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundGamePacket;

#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
pub struct ServerboundClientTickEnd {}
pub struct ServerboundClientTickEnd;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundGamePacket;

#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
pub struct ServerboundConfigurationAcknowledged {}
pub struct ServerboundConfigurationAcknowledged;
2 changes: 1 addition & 1 deletion azalea-protocol/src/packets/login/s_login_acknowledged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundLoginPacket;

#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)]
pub struct ServerboundLoginAcknowledged {}
pub struct ServerboundLoginAcknowledged;
2 changes: 1 addition & 1 deletion azalea-protocol/src/packets/status/s_status_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundStatusPacket;

#[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)]
pub struct ServerboundStatusRequest {}
pub struct ServerboundStatusRequest;
2 changes: 1 addition & 1 deletion azalea/src/auto_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use azalea_block::{Block, BlockState};
use azalea_client::{inventory::Inventory, Client};
use azalea_entity::{FluidOnEyes, Physics};
use azalea_inventory::{components, ItemStack, Menu};
use azalea_registry::{DataComponentKind, Fluid};
use azalea_registry::Fluid;

#[derive(Debug)]
pub struct BestToolResult {
Expand Down

0 comments on commit f364ad6

Please sign in to comment.