1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

add a couple more packets

This commit is contained in:
mat 2022-05-07 18:47:16 -05:00
parent 1a15d36e6b
commit 0b84e1cbb8
4 changed files with 33 additions and 0 deletions

View file

@ -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!();

View file

@ -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,
}

View file

@ -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,
}

View file

@ -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,