aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/mod.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-18 22:38:53 -0500
committermat <github@matdoes.dev>2022-04-18 22:38:53 -0500
commit751098b636c9aee54b9ca7a465fdaa769f10be4d (patch)
tree9ed0cd253dd95e6af3b2eefea86ad507dff4e19e /azalea-protocol/src/packets/game/mod.rs
parent78e692efc3fffc939f1b5af02e3cf32ca5302265 (diff)
downloadazalea-drasl-751098b636c9aee54b9ca7a465fdaa769f10be4d.tar.xz
start working on declare commands packet
Diffstat (limited to 'azalea-protocol/src/packets/game/mod.rs')
-rw-r--r--azalea-protocol/src/packets/game/mod.rs9
1 files changed, 9 insertions, 0 deletions
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),
},