aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-21 22:10:33 -0500
committermat <github@matdoes.dev>2022-06-21 22:10:33 -0500
commit0280fb58e1c2ae4194543f318c9b88584a20039c (patch)
tree0cd4ed48c6ecbafec93b2f3f8eac1bdd8a78803d /azalea-protocol/src
parent0d1e17197bf603d14241f89e9eb3572cf79766cb (diff)
downloadazalea-drasl-0280fb58e1c2ae4194543f318c9b88584a20039c.tar.xz
add serverbound move packets
Diffstat (limited to 'azalea-protocol/src')
-rwxr-xr-xazalea-protocol/src/packets/game/mod.rs8
-rw-r--r--azalea-protocol/src/packets/game/serverbound_move_player_packet_pos.rs9
-rw-r--r--azalea-protocol/src/packets/game/serverbound_move_player_packet_pos_rot.rs11
-rw-r--r--azalea-protocol/src/packets/game/serverbound_move_player_packet_rot.rs8
-rw-r--r--azalea-protocol/src/packets/game/serverbound_move_player_packet_status_only.rs6
5 files changed, 42 insertions, 0 deletions
diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs
index c4435636..80cada9b 100755
--- a/azalea-protocol/src/packets/game/mod.rs
+++ b/azalea-protocol/src/packets/game/mod.rs
@@ -53,6 +53,10 @@ pub mod serverbound_chat_command_packet;
pub mod serverbound_chat_preview_packet;
pub mod serverbound_custom_payload_packet;
pub mod serverbound_keep_alive_packet;
+pub mod serverbound_move_player_packet_pos;
+pub mod serverbound_move_player_packet_pos_rot;
+pub mod serverbound_move_player_packet_rot;
+pub mod serverbound_move_player_packet_status_only;
use packet_macros::declare_state_packets;
@@ -63,6 +67,10 @@ declare_state_packets!(
0x05: serverbound_chat_preview_packet::ServerboundChatPreviewPacket,
0x0c: serverbound_custom_payload_packet::ServerboundCustomPayloadPacket,
0x11: serverbound_keep_alive_packet::ServerboundKeepAlivePacket,
+ 0x13: serverbound_move_player_packet_pos::ServerboundMovePlayerPacketPos,
+ 0x14: serverbound_move_player_packet_pos_rot::ServerboundMovePlayerPacketPosRot,
+ 0x15: serverbound_move_player_packet_rot::ServerboundMovePlayerPacketRot,
+ 0x16: serverbound_move_player_packet_status_only::ServerboundMovePlayerPacketStatusOnly,
},
Clientbound => {
0x00: clientbound_add_entity_packet::ClientboundAddEntityPacket,
diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_packet_pos.rs b/azalea-protocol/src/packets/game/serverbound_move_player_packet_pos.rs
new file mode 100644
index 00000000..65b28624
--- /dev/null
+++ b/azalea-protocol/src/packets/game/serverbound_move_player_packet_pos.rs
@@ -0,0 +1,9 @@
+use packet_macros::{GamePacket, McBuf};
+
+#[derive(Clone, Debug, McBuf, GamePacket)]
+pub struct ServerboundMovePlayerPacketPos {
+ pub x: f64,
+ pub y: f64,
+ pub z: f64,
+ pub on_ground: bool,
+}
diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_packet_pos_rot.rs b/azalea-protocol/src/packets/game/serverbound_move_player_packet_pos_rot.rs
new file mode 100644
index 00000000..8070d1bf
--- /dev/null
+++ b/azalea-protocol/src/packets/game/serverbound_move_player_packet_pos_rot.rs
@@ -0,0 +1,11 @@
+use packet_macros::{GamePacket, McBuf};
+
+#[derive(Clone, Debug, McBuf, GamePacket)]
+pub struct ServerboundMovePlayerPacketPosRot {
+ pub x: f64,
+ pub y: f64,
+ pub z: f64,
+ pub y_rot: f32,
+ pub x_rot: f32,
+ pub on_ground: bool,
+}
diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_packet_rot.rs b/azalea-protocol/src/packets/game/serverbound_move_player_packet_rot.rs
new file mode 100644
index 00000000..0c444d03
--- /dev/null
+++ b/azalea-protocol/src/packets/game/serverbound_move_player_packet_rot.rs
@@ -0,0 +1,8 @@
+use packet_macros::{GamePacket, McBuf};
+
+#[derive(Clone, Debug, McBuf, GamePacket)]
+pub struct ServerboundMovePlayerPacketRot {
+ pub y_rot: f32,
+ pub x_rot: f32,
+ pub on_ground: bool,
+}
diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_packet_status_only.rs b/azalea-protocol/src/packets/game/serverbound_move_player_packet_status_only.rs
new file mode 100644
index 00000000..ef762caf
--- /dev/null
+++ b/azalea-protocol/src/packets/game/serverbound_move_player_packet_status_only.rs
@@ -0,0 +1,6 @@
+use packet_macros::{GamePacket, McBuf};
+
+#[derive(Clone, Debug, McBuf, GamePacket)]
+pub struct ServerboundMovePlayerPacketStatusOnly {
+ pub on_ground: bool,
+}