aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/clientbound_sound_packet.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-07 21:54:27 -0500
committermat <github@matdoes.dev>2022-05-07 21:54:27 -0500
commitffba10185401ebdbfd93b1181eda04ce08fa72d5 (patch)
tree5934033d0ffad3d027e69ed465478fca2438916c /azalea-protocol/src/packets/game/clientbound_sound_packet.rs
parentf62a681474df698d87deb43c71238b83a26f0f1f (diff)
downloadazalea-drasl-ffba10185401ebdbfd93b1181eda04ce08fa72d5.tar.xz
chat and sound packets
Diffstat (limited to 'azalea-protocol/src/packets/game/clientbound_sound_packet.rs')
-rw-r--r--azalea-protocol/src/packets/game/clientbound_sound_packet.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_sound_packet.rs b/azalea-protocol/src/packets/game/clientbound_sound_packet.rs
new file mode 100644
index 00000000..67e832fe
--- /dev/null
+++ b/azalea-protocol/src/packets/game/clientbound_sound_packet.rs
@@ -0,0 +1,28 @@
+use packet_macros::{GamePacket, McBufReadable, McBufWritable};
+
+#[derive(Clone, Debug, GamePacket)]
+pub struct ClientboundSoundPacket {
+ #[var]
+ /// TODO: use the sound registry instead of just being a u32
+ pub sound: u32,
+ pub source: SoundSource,
+ pub x: i32,
+ pub y: i32,
+ pub z: i32,
+ pub volume: f32,
+ pub pitch: f32,
+}
+
+#[derive(Clone, Debug, Copy, McBufReadable, McBufWritable)]
+pub enum SoundSource {
+ Master = 0,
+ Music = 1,
+ Records = 2,
+ Weather = 3,
+ Blocks = 4,
+ Hostile = 5,
+ Neutral = 6,
+ Players = 7,
+ Ambient = 8,
+ Voice = 9,
+}