diff options
| author | mat <github@matdoes.dev> | 2022-05-07 18:44:00 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-07 18:44:00 -0500 |
| commit | 1a15d36e6b9bb33340f1422b6b282dd13e9b4840 (patch) | |
| tree | 2cb7df44cb1605c542db15c59ec59abeff7bab0b | |
| parent | d9e388d8b0d8b3bdcf7a2e21b0cd2daa78d295e7 (diff) | |
| download | azalea-drasl-1a15d36e6b9bb33340f1422b6b282dd13e9b4840.tar.xz | |
add health packet
| -rwxr-xr-x | azalea-client/src/connect.rs | 3 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_set_health_packet.rs | 9 | ||||
| -rwxr-xr-x | azalea-protocol/src/packets/game/mod.rs | 2 | ||||
| -rw-r--r-- | code-generator/README.md | 2 | ||||
| -rw-r--r-- | code-generator/main.py | 4 |
6 files changed, 20 insertions, 2 deletions
diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index e35024e0..b9f6af98 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -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!(); diff --git a/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs b/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs index e46f5af1..aea09e09 100644 --- a/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs @@ -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, } diff --git a/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs new file mode 100644 index 00000000..136ef475 --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs @@ -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, +} diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index d112f576..776c5d41 100755 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -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, diff --git a/code-generator/README.md b/code-generator/README.md index 5b9a6139..a6c60c47 100644 --- a/code-generator/README.md +++ b/code-generator/README.md @@ -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. diff --git a/code-generator/main.py b/code-generator/main.py index 5ab3219f..78d307b7 100644 --- a/code-generator/main.py +++ b/code-generator/main.py @@ -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) |
