aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/interact/mod.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-08-14 20:40:13 -0500
committerGitHub <noreply@github.com>2025-08-14 20:40:13 -0500
commite74ed047dbaf3877db4a89a2d589e992abd0bb11 (patch)
tree0a728c8be167a1d59a5492ed9df666f41cf12e57 /azalea-client/src/plugins/interact/mod.rs
parent6695132ddb31780786c67b8b9ff5df8ab3891438 (diff)
downloadazalea-drasl-e74ed047dbaf3877db4a89a2d589e992abd0bb11.tar.xz
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
Diffstat (limited to 'azalea-client/src/plugins/interact/mod.rs')
-rw-r--r--azalea-client/src/plugins/interact/mod.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/azalea-client/src/plugins/interact/mod.rs b/azalea-client/src/plugins/interact/mod.rs
index 634d492c..0275ca97 100644
--- a/azalea-client/src/plugins/interact/mod.rs
+++ b/azalea-client/src/plugins/interact/mod.rs
@@ -11,7 +11,7 @@ use azalea_core::{
tick::GameTick,
};
use azalea_entity::{
- Attributes, LocalEntity, LookDirection,
+ Attributes, Crouching, LocalEntity, LookDirection, PlayerAbilities,
attributes::{
creative_block_interaction_range_modifier, creative_entity_interaction_range_modifier,
},
@@ -36,7 +36,7 @@ use crate::{
attack::handle_attack_event,
interact::pick::{HitResultComponent, update_hit_result_component},
inventory::{Inventory, InventorySet},
- local_player::{LocalGameMode, PermissionLevel, PlayerAbilities},
+ local_player::{LocalGameMode, PermissionLevel},
movement::MoveEventsSet,
packet::game::SendPacketEvent,
respawn::perform_respawn,
@@ -250,12 +250,20 @@ pub fn handle_start_use_item_queued(
&mut BlockStatePredictionHandler,
&HitResultComponent,
&LookDirection,
+ &Crouching,
Option<&Mining>,
)>,
entity_id_query: Query<&MinecraftEntityId>,
) {
- for (entity, start_use_item, mut prediction_handler, hit_result, look_direction, mining) in
- query
+ for (
+ entity,
+ start_use_item,
+ mut prediction_handler,
+ hit_result,
+ look_direction,
+ crouching,
+ mining,
+ ) in query
{
commands.entity(entity).remove::<StartUseItemQueued>();
@@ -332,8 +340,7 @@ pub fn handle_start_use_item_queued(
location: r.location,
hand: InteractionHand::MainHand,
},
- // TODO: sneaking
- using_secondary_action: false,
+ using_secondary_action: **crouching,
},
));
}