diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-02-22 21:45:26 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-22 21:45:26 -0600 |
| commit | e21e1b97bf9337e9f4747cd1b545b1b3a03e2ce7 (patch) | |
| tree | add6f8bfce40d0c07845d8aa4c9945a0b918444c /azalea-protocol | |
| parent | f8130c3c92946d2293634ba4e252d6bc93026c3c (diff) | |
| download | azalea-drasl-e21e1b97bf9337e9f4747cd1b545b1b3a03e2ce7.tar.xz | |
Refactor azalea-client (#205)
* start organizing packet_handling more by moving packet handlers into their own functions
* finish writing all the handler functions for packets
* use macro for generating match statement for packet handler functions
* fix set_entity_data
* update config state to also use handler functions
* organize az-client file structure by moving things into plugins directory
* fix merge issues
Diffstat (limited to 'azalea-protocol')
| -rwxr-xr-x | azalea-protocol/src/packets/game/c_add_entity.rs | 6 | ||||
| -rwxr-xr-x | azalea-protocol/src/packets/game/c_set_entity_motion.rs | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/azalea-protocol/src/packets/game/c_add_entity.rs b/azalea-protocol/src/packets/game/c_add_entity.rs index 67615fb9..28f86a3e 100755 --- a/azalea-protocol/src/packets/game/c_add_entity.rs +++ b/azalea-protocol/src/packets/game/c_add_entity.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; -use azalea_core::{position::Vec3, resource_location::ResourceLocation}; +use azalea_core::{delta::PositionDelta8, position::Vec3, resource_location::ResourceLocation}; use azalea_entity::{metadata::apply_default_metadata, EntityBundle}; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; @@ -18,9 +18,7 @@ pub struct ClientboundAddEntity { pub y_head_rot: i8, #[var] pub data: u32, - pub x_vel: i16, - pub y_vel: i16, - pub z_vel: i16, + pub velocity: PositionDelta8, } impl ClientboundAddEntity { diff --git a/azalea-protocol/src/packets/game/c_set_entity_motion.rs b/azalea-protocol/src/packets/game/c_set_entity_motion.rs index 7a112784..06b457f7 100755 --- a/azalea-protocol/src/packets/game/c_set_entity_motion.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_motion.rs @@ -1,4 +1,5 @@ use azalea_buf::AzBuf; +use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; @@ -6,7 +7,5 @@ use azalea_world::MinecraftEntityId; pub struct ClientboundSetEntityMotion { #[var] pub id: MinecraftEntityId, - pub xa: i16, - pub ya: i16, - pub za: i16, + pub delta: PositionDelta8, } |
