aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/attack.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-09-28 13:10:04 -0545
committermat <git@matdoes.dev>2025-09-28 13:10:04 -0545
commit2c8b7c5c2c9297273abfba8f7743f1bc25f166b1 (patch)
tree3d3aded400100c136287fa59293ce26c61644d00 /azalea-client/src/plugins/attack.rs
parente2ed19c1ed92f0dccc881d835d9ac6e0f7f834c0 (diff)
downloadazalea-drasl-2c8b7c5c2c9297273abfba8f7743f1bc25f166b1.tar.xz
upgrade bevy to 0.17.0-rc.2
Diffstat (limited to 'azalea-client/src/plugins/attack.rs')
-rw-r--r--azalea-client/src/plugins/attack.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs
index 7d730bb7..47e45896 100644
--- a/azalea-client/src/plugins/attack.rs
+++ b/azalea-client/src/plugins/attack.rs
@@ -19,7 +19,7 @@ use crate::{
pub struct AttackPlugin;
impl Plugin for AttackPlugin {
fn build(&self, app: &mut App) {
- app.add_event::<AttackEvent>()
+ app.add_message::<AttackEvent>()
.add_systems(
Update,
handle_attack_event
@@ -45,7 +45,7 @@ impl Plugin for AttackPlugin {
impl Client {
/// Attack the entity with the given id.
pub fn attack(&self, entity: Entity) {
- self.ecs.lock().send_event(AttackEvent {
+ self.ecs.lock().write_message(AttackEvent {
entity: self.entity,
target: entity,
});
@@ -148,14 +148,14 @@ pub fn handle_attack_queued(
/// Queues up an attack packet for next tick by inserting the [`AttackQueued`]
/// component to our client.
-#[derive(Event)]
+#[derive(Message)]
pub struct AttackEvent {
/// Our client entity that will send the packets to attack.
pub entity: Entity,
/// The entity that will be attacked.
pub target: Entity,
}
-pub fn handle_attack_event(mut events: EventReader<AttackEvent>, mut commands: Commands) {
+pub fn handle_attack_event(mut events: MessageReader<AttackEvent>, mut commands: Commands) {
for event in events.read() {
commands.entity(event.entity).insert(AttackQueued {
target: event.target,