From cde7e35046b726b07bf3e067c080b85a12b2fd74 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sat, 15 Jul 2023 04:39:43 -0500 Subject: Attacking (#96) * add Client::attack * partially implement attack cooldowns * attack speed modifiers * don't care clippy --------- Co-authored-by: mat --- azalea-client/src/mining.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'azalea-client/src/mining.rs') diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index 049bc859..c087c467 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -18,6 +18,7 @@ use crate::{ }, inventory::InventoryComponent, local_player::{LocalGameMode, SendPacketEvent}, + Client, }; /// A plugin that allows clients to break blocks in the world. @@ -44,6 +45,15 @@ impl Plugin for MinePlugin { } } +impl Client { + pub fn start_mining(&mut self, position: BlockPos) { + self.ecs.lock().send_event(StartMiningBlockEvent { + entity: self.entity, + position, + }); + } +} + /// Information about the block we're currently mining. This is only present if /// we're currently mining a block. #[derive(Component)] -- cgit v1.2.3