aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xazalea-client/src/connect.rs6
-rw-r--r--azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs10
-rw-r--r--azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs13
-rwxr-xr-xazalea-protocol/src/packets/game/mod.rs4
4 files changed, 33 insertions, 0 deletions
diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs
index b9f6af98..cd6891c0 100755
--- a/azalea-client/src/connect.rs
+++ b/azalea-client/src/connect.rs
@@ -273,6 +273,12 @@ impl Client {
GamePacket::ClientboundSetHealthPacket(p) => {
println!("Got set health packet {:?}", p);
}
+ GamePacket::ClientboundSetExperiencePacket(p) => {
+ println!("Got set experience packet {:?}", p);
+ }
+ GamePacket::ClientboundTeleportEntityPacket(p) => {
+ println!("Got teleport entity packet {:?}", p);
+ }
_ => panic!("Unexpected packet {:?}", packet),
}
println!();
diff --git a/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs
new file mode 100644
index 00000000..88c306dc
--- /dev/null
+++ b/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs
@@ -0,0 +1,10 @@
+use packet_macros::GamePacket;
+
+#[derive(Clone, Debug, GamePacket)]
+pub struct ClientboundSetExperiencePacket {
+ pub experience_progress: f32,
+ #[var]
+ pub experience_level: u32,
+ #[var]
+ pub total_experience: u32,
+}
diff --git a/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs
new file mode 100644
index 00000000..ea8788d6
--- /dev/null
+++ b/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs
@@ -0,0 +1,13 @@
+use packet_macros::GamePacket;
+
+#[derive(Clone, Debug, GamePacket)]
+pub struct ClientboundTeleportEntityPacket {
+ #[var]
+ pub id: u32,
+ pub x: f64,
+ pub y: f64,
+ pub z: f64,
+ pub y_rot: i8,
+ pub x_rot: i8,
+ pub on_ground: bool,
+}
diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs
index 776c5d41..d3ea7281 100755
--- a/azalea-protocol/src/packets/game/mod.rs
+++ b/azalea-protocol/src/packets/game/mod.rs
@@ -21,8 +21,10 @@ pub mod clientbound_set_chunk_cache_center;
pub mod clientbound_set_default_spawn_position_packet;
pub mod clientbound_set_entity_data_packet;
pub mod clientbound_set_entity_link_packet;
+pub mod clientbound_set_experience_packet;
pub mod clientbound_set_health_packet;
pub mod clientbound_set_time_packet;
+pub mod clientbound_teleport_entity_packet;
pub mod clientbound_update_attributes_packet;
pub mod clientbound_update_recipes_packet;
pub mod clientbound_update_tags_packet;
@@ -61,8 +63,10 @@ declare_state_packets!(
0x4d: clientbound_set_entity_data_packet::ClientboundSetEntityDataPacket,
0x45: clientbound_set_entity_link_packet::ClientboundSetEntityLinkPacket,
0x4f: clientbound_entity_velocity_packet::ClientboundEntityVelocityPacket,
+ 0x51: clientbound_set_experience_packet::ClientboundSetExperiencePacket,
0x52: clientbound_set_health_packet::ClientboundSetHealthPacket,
0x59: clientbound_set_time_packet::ClientboundSetTimePacket,
+ 0x62: clientbound_teleport_entity_packet::ClientboundTeleportEntityPacket,
0x64: clientbound_update_attributes_packet::ClientboundUpdateAttributesPacket,
0x66: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket,
0x67: clientbound_update_tags_packet::ClientboundUpdateTagsPacket,