diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-03-24 11:15:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-24 11:15:56 -0500 |
| commit | eeaf1435e81d9cbd8daa0efa22029c1f259a64b5 (patch) | |
| tree | 3486e26d5409708370e4e259d240fb77c6e1e439 /azalea-client/src/plugins/interact | |
| parent | 41a9ae6aaff77646c08c64ac1334a8cc6081c24f (diff) | |
| download | azalea-drasl-eeaf1435e81d9cbd8daa0efa22029c1f259a64b5.tar.xz | |
26.1 (#316)
* start updating to 26.1
* start updating to 26.1-snapshot-6
* 26.1-snapshot-6
* 26.1-snapshot-10
* 26.1-rc-1
* fix tests
* 26.1-rc-2 and sort default components
* 26.1
* update changelog
Diffstat (limited to 'azalea-client/src/plugins/interact')
| -rw-r--r-- | azalea-client/src/plugins/interact/mod.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/azalea-client/src/plugins/interact/mod.rs b/azalea-client/src/plugins/interact/mod.rs index 04986de7..0eb43818 100644 --- a/azalea-client/src/plugins/interact/mod.rs +++ b/azalea-client/src/plugins/interact/mod.rs @@ -4,6 +4,7 @@ use std::collections::HashMap; use azalea_block::BlockState; use azalea_core::{ + delta::LpVec3, direction::Direction, game_type::GameMode, hit_result::{BlockHitResult, HitResult}, @@ -25,10 +26,8 @@ use azalea_physics::{ local_player::PhysicsState, }; use azalea_protocol::packets::game::{ - ServerboundInteract, ServerboundUseItem, - s_interact::{self, InteractionHand}, - s_swing::ServerboundSwing, - s_use_item_on::ServerboundUseItemOn, + ServerboundInteract, ServerboundUseItem, s_interact::InteractionHand, + s_swing::ServerboundSwing, s_use_item_on::ServerboundUseItemOn, }; use azalea_world::World; use bevy_app::{App, Plugin, Update}; @@ -350,12 +349,10 @@ pub fn handle_entity_interact( } }; - let mut interact = ServerboundInteract { + let interact = ServerboundInteract { entity_id, - action: s_interact::ActionType::InteractAt { - location, - hand: InteractionHand::MainHand, - }, + hand: InteractionHand::MainHand, + location: LpVec3::from(location), using_secondary_action: physics_state.trying_to_crouch, }; commands.trigger(SendGamePacketEvent::new(trigger.client, interact.clone())); @@ -364,11 +361,8 @@ pub fn handle_entity_interact( // in certain cases when interacting with armor stands let consumes_action = false; if !consumes_action { - // but yes, most of the time vanilla really does send two interact packets like - // this - interact.action = s_interact::ActionType::Interact { - hand: InteractionHand::MainHand, - }; + // but yes, most of the time vanilla really does send two identical interact + // packets like this commands.trigger(SendGamePacketEvent::new(trigger.client, interact)); } } |
