From 751098b636c9aee54b9ca7a465fdaa769f10be4d Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 18 Apr 2022 22:38:53 -0500 Subject: start working on declare commands packet --- azalea-protocol/src/packets/game/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'azalea-protocol/src/packets/game/mod.rs') diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index 4efe72fb..1fd47132 100644 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -1,5 +1,6 @@ pub mod clientbound_change_difficulty_packet; pub mod clientbound_custom_payload_packet; +pub mod clientbound_declare_commands_packet; pub mod clientbound_login_packet; pub mod clientbound_update_view_distance_packet; @@ -22,6 +23,9 @@ where ClientboundChangeDifficultyPacket( clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket, ), + ClientboundDeclareCommandsPacket( + clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket, + ), } #[async_trait] @@ -32,6 +36,7 @@ impl ProtocolPacket for GamePacket { GamePacket::ClientboundCustomPayloadPacket(_packet) => 0x18, GamePacket::ClientboundLoginPacket(_packet) => 0x26, GamePacket::ClientboundUpdateViewDistancePacket(_packet) => 0x4a, + GamePacket::ClientboundDeclareCommandsPacket(_packet) => 0x12, } } @@ -41,6 +46,7 @@ impl ProtocolPacket for GamePacket { GamePacket::ClientboundCustomPayloadPacket(packet) => packet.write(buf), GamePacket::ClientboundLoginPacket(packet) => packet.write(buf), GamePacket::ClientboundUpdateViewDistancePacket(packet) => packet.write(buf), + GamePacket::ClientboundDeclareCommandsPacket(packet) => packet.write(buf), } } @@ -63,6 +69,9 @@ impl ProtocolPacket for GamePacket { 0x4a => clientbound_update_view_distance_packet::ClientboundUpdateViewDistancePacket ::read(buf) .await?, + 0x12 => clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket + ::read(buf) + .await?, // _ => return Err(format!("Unknown ServerToClient game packet id: {}", id)), _ => panic!("Unknown ServerToClient game packet id: {}", id), }, -- cgit v1.2.3 From a3fad4765b7ef2077fde0b5c87a5cf657f9f6584 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 19 Apr 2022 21:03:10 -0500 Subject: reorder some packets --- azalea-protocol/src/packets/game/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'azalea-protocol/src/packets/game/mod.rs') diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index 904b38c8..2dbf7f24 100644 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -11,9 +11,9 @@ declare_state_packets!( Serverbound => {}, Clientbound => { 0x0e: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket, + 0x12: clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket, 0x18: clientbound_custom_payload_packet::ClientboundCustomPayloadPacket, 0x26: clientbound_login_packet::ClientboundLoginPacket, - 0x4a: clientbound_update_view_distance_packet::ClientboundUpdateViewDistancePacket, - 0x12: clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket + 0x4a: clientbound_update_view_distance_packet::ClientboundUpdateViewDistancePacket } ); -- cgit v1.2.3