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

add health packet

This commit is contained in:
mat 2022-05-07 18:44:00 -05:00
parent d9e388d8b0
commit 1a15d36e6b
6 changed files with 20 additions and 2 deletions

View file

@ -270,6 +270,9 @@ impl Client {
GamePacket::ClientboundContainerSetContentPacket(p) => {
println!("Got container set content packet {:?}", p);
}
GamePacket::ClientboundSetHealthPacket(p) => {
println!("Got set health packet {:?}", p);
}
_ => panic!("Unexpected packet {:?}", packet),
}
println!();

View file

@ -5,7 +5,7 @@ use packet_macros::GamePacket;
pub struct ClientboundContainerSetContentPacket {
pub container_id: u8,
#[var]
pub state_id: i32,
pub state_id: u32,
pub items: Vec<Slot>,
pub carried_item: Slot,
}

View file

@ -0,0 +1,9 @@
use packet_macros::GamePacket;
#[derive(Clone, Debug, GamePacket)]
pub struct ClientboundSetHealthPacket {
pub health: f32,
#[var]
pub food: u32,
pub saturation: f32,
}

View file

@ -21,6 +21,7 @@ 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_health_packet;
pub mod clientbound_set_time_packet;
pub mod clientbound_update_attributes_packet;
pub mod clientbound_update_recipes_packet;
@ -60,6 +61,7 @@ declare_state_packets!(
0x4d: clientbound_set_entity_data_packet::ClientboundSetEntityDataPacket,
0x45: clientbound_set_entity_link_packet::ClientboundSetEntityLinkPacket,
0x4f: clientbound_entity_velocity_packet::ClientboundEntityVelocityPacket,
0x52: clientbound_set_health_packet::ClientboundSetHealthPacket,
0x59: clientbound_set_time_packet::ClientboundSetTimePacket,
0x64: clientbound_update_attributes_packet::ClientboundUpdateAttributesPacket,
0x66: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket,

View file

@ -1,4 +1,4 @@
Tools for generating code.
Tools for automatically generating code to help with updating Minecraft versions.
The directory name doesn't start with `azalea-` because it's not a Rust crate.

View file

@ -32,6 +32,10 @@ if not skipping_burger:
print('\033[92mDownloading Burger...\033[m')
r = os.system('git clone https://github.com/pokechu22/Burger')
os.system('cd Burger && git pull')
# print('\033[92mInstalling dependencies...\033[m')
# os.system('cd Burger && pip install six jawa')
print('\033[92mDownloading client jar...\033[m')
with open('client.jar', 'wb') as f:
f.write(requests.get(client_jar_url).content)