From e74ed047dbaf3877db4a89a2d589e992abd0bb11 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 14 Aug 2025 20:40:13 -0500 Subject: Sneaking (#237) * start implementing sneaking * fix horizontal_collision being inverted and cleanup * clippy * change dimensions and eye height based on pose * proper support for automatically crouching in certain cases * fix anticheat issues * add line to changelog and update a comment --- azalea-protocol/src/packets/game/c_player_abilities.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'azalea-protocol/src/packets') diff --git a/azalea-protocol/src/packets/game/c_player_abilities.rs b/azalea-protocol/src/packets/game/c_player_abilities.rs index 3f4e1024..8f7bbf20 100644 --- a/azalea-protocol/src/packets/game/c_player_abilities.rs +++ b/azalea-protocol/src/packets/game/c_player_abilities.rs @@ -1,8 +1,8 @@ use std::io::{self, Cursor, Write}; -use azalea_buf::{AzBuf, BufReadError}; -use azalea_buf::{AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_core::bitset::FixedBitSet; +use azalea_entity::PlayerAbilities; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] @@ -51,3 +51,16 @@ impl AzaleaWrite for PlayerAbilitiesFlags { set.azalea_write(buf) } } + +impl From<&ClientboundPlayerAbilities> for PlayerAbilities { + fn from(packet: &ClientboundPlayerAbilities) -> Self { + Self { + invulnerable: packet.flags.invulnerable, + flying: packet.flags.flying, + can_fly: packet.flags.can_fly, + instant_break: packet.flags.instant_break, + flying_speed: packet.flying_speed, + walking_speed: packet.walking_speed, + } + } +} -- cgit v1.2.3