diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2025-12-27 22:02:00 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-27 22:02:00 -0600 |
| commit | 9513f42e87f64c409cdb2a100500a50e5a713bac (patch) | |
| tree | bb6aa8b6d50fddf967bcb1f759e023754ea84e49 /azalea-client/src/plugins/interact/mod.rs | |
| parent | 588902ba4a3965982bdd84d92b20c6f7613f3978 (diff) | |
| download | azalea-drasl-9513f42e87f64c409cdb2a100500a50e5a713bac.tar.xz | |
Move Client struct to azalea crate (#297)
* move the Client struct out of azalea-client into azalea
* actually add client impls in azalea
Diffstat (limited to 'azalea-client/src/plugins/interact/mod.rs')
| -rw-r--r-- | azalea-client/src/plugins/interact/mod.rs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/azalea-client/src/plugins/interact/mod.rs b/azalea-client/src/plugins/interact/mod.rs index df614b8a..d2a4ef44 100644 --- a/azalea-client/src/plugins/interact/mod.rs +++ b/azalea-client/src/plugins/interact/mod.rs @@ -38,7 +38,6 @@ use tracing::warn; use super::mining::Mining; use crate::{ - Client, attack::handle_attack_event, interact::pick::{HitResultComponent, update_hit_result_component}, inventory::InventorySystems, @@ -85,52 +84,6 @@ impl Plugin for InteractPlugin { #[derive(Clone, Debug, Eq, Hash, PartialEq, SystemSet)] pub struct UpdateAttributesSystems; -impl Client { - /// Right-click a block. - /// - /// The behavior of this depends on the target block, - /// and it'll either place the block you're holding in your hand or use the - /// block you clicked (like toggling a lever). - /// - /// Note that this may trigger anticheats as it doesn't take into account - /// whether you're actually looking at the block. - pub fn block_interact(&self, position: BlockPos) { - self.ecs.lock().write_message(StartUseItemEvent { - entity: self.entity, - hand: InteractionHand::MainHand, - force_block: Some(position), - }); - } - - /// Right-click an entity. - /// - /// This can click through walls, which may trigger anticheats. If that - /// behavior isn't desired, consider using [`Client::start_use_item`] - /// instead. - pub fn entity_interact(&self, entity: Entity) { - self.ecs.lock().trigger(EntityInteractEvent { - client: self.entity, - target: entity, - location: None, - }); - } - - /// Right-click the currently held item. - /// - /// If the item is consumable, then it'll act as if right-click was held - /// until the item finishes being consumed. You can use this to eat food. - /// - /// If we're looking at a block or entity, then it will be clicked. Also see - /// [`Client::block_interact`] and [`Client::entity_interact`]. - pub fn start_use_item(&self) { - self.ecs.lock().write_message(StartUseItemEvent { - entity: self.entity, - hand: InteractionHand::MainHand, - force_block: None, - }); - } -} - /// A component that contains information about our local block state /// predictions. #[derive(Clone, Component, Debug, Default)] |
