diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-07-15 04:39:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-15 04:39:43 -0500 |
| commit | cde7e35046b726b07bf3e067c080b85a12b2fd74 (patch) | |
| tree | 9d517911cbaf14f007958a92392101f24ec14118 /azalea-client/src/mining.rs | |
| parent | 148f20381750be3e2c38a6bdaf8d339113da1b39 (diff) | |
| download | azalea-drasl-cde7e35046b726b07bf3e067c080b85a12b2fd74.tar.xz | |
Attacking (#96)
* add Client::attack
* partially implement attack cooldowns
* attack speed modifiers
* don't care clippy
---------
Co-authored-by: mat <git@matdoes.dev>
Diffstat (limited to 'azalea-client/src/mining.rs')
| -rw-r--r-- | azalea-client/src/mining.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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)] |
