aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-25 01:10:03 -0100
committermat <git@matdoes.dev>2025-04-25 01:10:03 -0100
commitb3af8d73faa2663e25e5688897720e57842f99ae (patch)
treefdc16e01fabce7b7ec4e9f1ff702fe3e6c10dfe5 /azalea-client/src
parent65c9f555b0274ce9c56aafb73f3f59dbf80f3a85 (diff)
downloadazalea-drasl-b3af8d73faa2663e25e5688897720e57842f99ae.tar.xz
update to bevy 0.16
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/client.rs8
-rw-r--r--azalea-client/src/plugins/attack.rs3
-rw-r--r--azalea-client/src/plugins/chat/mod.rs11
-rw-r--r--azalea-client/src/plugins/disconnect.rs12
-rw-r--r--azalea-client/src/plugins/events.rs9
-rw-r--r--azalea-client/src/plugins/interact.rs10
-rw-r--r--azalea-client/src/plugins/inventory.rs11
-rw-r--r--azalea-client/src/plugins/login.rs2
-rw-r--r--azalea-client/src/plugins/mining.rs30
-rw-r--r--azalea-client/src/plugins/movement.rs8
-rw-r--r--azalea-client/src/plugins/packet/config/mod.rs6
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs38
-rw-r--r--azalea-client/src/plugins/packet/login/mod.rs4
-rw-r--r--azalea-client/src/plugins/packet/mod.rs2
-rw-r--r--azalea-client/src/plugins/pong.rs4
-rw-r--r--azalea-client/src/plugins/task_pool.rs2
-rw-r--r--azalea-client/src/test_simulation.rs6
17 files changed, 63 insertions, 103 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 6937348d..4d803994 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -32,12 +32,8 @@ use azalea_protocol::{
use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId, PartialInstance};
use bevy_app::{App, Plugin, PluginsState, Update};
use bevy_ecs::{
- bundle::Bundle,
- component::Component,
- entity::Entity,
- schedule::{InternedScheduleLabel, IntoSystemConfigs, LogLevel, ScheduleBuildSettings},
- system::Resource,
- world::World,
+ prelude::*,
+ schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings},
};
use parking_lot::{Mutex, RwLock};
use simdnbt::owned::NbtCompound;
diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs
index c9ecde56..137e3375 100644
--- a/azalea-client/src/plugins/attack.rs
+++ b/azalea-client/src/plugins/attack.rs
@@ -35,7 +35,8 @@ impl Plugin for AttackPlugin {
update_attack_strength_scale.after(PhysicsSet),
handle_attack_queued
.before(super::tick_end::game_tick_packet)
- .after(super::movement::send_sprinting_if_needed),
+ .after(super::movement::send_sprinting_if_needed)
+ .before(super::movement::send_position),
)
.chain(),
);
diff --git a/azalea-client/src/plugins/chat/mod.rs b/azalea-client/src/plugins/chat/mod.rs
index 8562f3ce..7d42eb20 100644
--- a/azalea-client/src/plugins/chat/mod.rs
+++ b/azalea-client/src/plugins/chat/mod.rs
@@ -10,12 +10,7 @@ use azalea_protocol::packets::game::{
c_system_chat::ClientboundSystemChat,
};
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::{
- entity::Entity,
- event::{EventReader, EventWriter},
- prelude::Event,
- schedule::IntoSystemConfigs,
-};
+use bevy_ecs::prelude::*;
use handler::{SendChatKindEvent, handle_send_chat_kind_event};
use uuid::Uuid;
@@ -204,13 +199,13 @@ pub fn handle_send_chat_event(
) {
for event in events.read() {
if event.content.starts_with('/') {
- send_chat_kind_events.send(SendChatKindEvent {
+ send_chat_kind_events.write(SendChatKindEvent {
entity: event.entity,
content: event.content[1..].to_string(),
kind: ChatKind::Command,
});
} else {
- send_chat_kind_events.send(SendChatKindEvent {
+ send_chat_kind_events.write(SendChatKindEvent {
entity: event.entity,
content: event.content.clone(),
kind: ChatKind::Message,
diff --git a/azalea-client/src/plugins/disconnect.rs b/azalea-client/src/plugins/disconnect.rs
index 6b1abdeb..343c25d8 100644
--- a/azalea-client/src/plugins/disconnect.rs
+++ b/azalea-client/src/plugins/disconnect.rs
@@ -3,15 +3,7 @@
use azalea_chat::FormattedText;
use azalea_entity::{EntityBundle, InLoadedChunk, LocalEntity, metadata::PlayerMetadataBundle};
use bevy_app::{App, Plugin, PostUpdate};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::{EventReader, EventWriter},
- prelude::Event,
- query::{Changed, With},
- schedule::IntoSystemConfigs,
- system::{Commands, Query},
-};
+use bevy_ecs::prelude::*;
use derive_more::Deref;
use tracing::info;
@@ -101,7 +93,7 @@ fn disconnect_on_connection_dead(
) {
for (entity, &is_connection_alive) in &query {
if !*is_connection_alive {
- disconnect_events.send(DisconnectEvent {
+ disconnect_events.write(DisconnectEvent {
entity,
reason: None,
});
diff --git a/azalea-client/src/plugins/events.rs b/azalea-client/src/plugins/events.rs
index e92242af..97094db5 100644
--- a/azalea-client/src/plugins/events.rs
+++ b/azalea-client/src/plugins/events.rs
@@ -9,14 +9,7 @@ use azalea_entity::{Dead, InLoadedChunk};
use azalea_protocol::packets::game::c_player_combat_kill::ClientboundPlayerCombatKill;
use azalea_world::{InstanceName, MinecraftEntityId};
use bevy_app::{App, Plugin, PreUpdate, Update};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::EventReader,
- query::{Added, With, Without},
- schedule::IntoSystemConfigs,
- system::{Commands, Query},
-};
+use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
use tokio::sync::mpsc;
diff --git a/azalea-client/src/plugins/interact.rs b/azalea-client/src/plugins/interact.rs
index 9e638a06..9ca216fb 100644
--- a/azalea-client/src/plugins/interact.rs
+++ b/azalea-client/src/plugins/interact.rs
@@ -19,15 +19,7 @@ use azalea_protocol::packets::game::{
};
use azalea_world::{Instance, InstanceContainer, InstanceName};
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::{Event, EventReader},
- observer::Trigger,
- query::{Changed, With},
- schedule::IntoSystemConfigs,
- system::{Commands, Query, Res},
-};
+use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
use tracing::warn;
diff --git a/azalea-client/src/plugins/inventory.rs b/azalea-client/src/plugins/inventory.rs
index e6394ab8..0a9c5cad 100644
--- a/azalea-client/src/plugins/inventory.rs
+++ b/azalea-client/src/plugins/inventory.rs
@@ -16,14 +16,7 @@ use azalea_protocol::packets::game::{
};
use azalea_registry::MenuKind;
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::EventReader,
- prelude::{Event, EventWriter},
- schedule::{IntoSystemConfigs, SystemSet},
- system::{Commands, Query},
-};
+use bevy_ecs::prelude::*;
use tracing::{error, warn};
use crate::{
@@ -628,7 +621,7 @@ fn handle_container_close_event(
container_id: inventory.id,
},
));
- client_side_events.send(ClientSideCloseContainerEvent {
+ client_side_events.write(ClientSideCloseContainerEvent {
entity: event.entity,
});
}
diff --git a/azalea-client/src/plugins/login.rs b/azalea-client/src/plugins/login.rs
index 385e9651..9a871ac3 100644
--- a/azalea-client/src/plugins/login.rs
+++ b/azalea-client/src/plugins/login.rs
@@ -27,7 +27,7 @@ fn handle_receive_hello_event(trigger: Trigger<ReceiveHelloEvent>, mut commands:
let account = trigger.account.clone();
let packet = trigger.packet.clone();
- let player = trigger.entity();
+ let player = trigger.target();
let task = task_pool.spawn(auth_with_account(account, packet));
commands.entity(player).insert(AuthTask(task));
diff --git a/azalea-client/src/plugins/mining.rs b/azalea-client/src/plugins/mining.rs
index 2dd50700..f4caec41 100644
--- a/azalea-client/src/plugins/mining.rs
+++ b/azalea-client/src/plugins/mining.rs
@@ -127,12 +127,12 @@ fn handle_auto_mine(
))
&& !hit_result_component.miss
{
- start_mining_block_event.send(StartMiningBlockEvent {
+ start_mining_block_event.write(StartMiningBlockEvent {
entity,
position: block_pos,
});
} else if mining.is_some() && hit_result_component.miss {
- stop_mining_block_event.send(StopMiningBlockEvent { entity });
+ stop_mining_block_event.write(StopMiningBlockEvent { entity });
}
}
}
@@ -168,7 +168,7 @@ fn handle_start_mining_block_event(
// we're not looking at the block, arbitrary direction
Direction::Down
};
- start_mining_events.send(StartMiningBlockWithDirectionEvent {
+ start_mining_events.write(StartMiningBlockWithDirectionEvent {
entity: event.entity,
position: event.position,
direction,
@@ -236,7 +236,7 @@ fn handle_start_mining_block_with_direction_event(
if game_mode.current == GameMode::Creative {
*sequence_number += 1;
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity: event.entity,
position: event.position,
});
@@ -283,7 +283,7 @@ fn handle_start_mining_block_with_direction_event(
if block_is_solid && **mine_progress == 0. {
// interact with the block (like note block left click) here
- attack_block_events.send(AttackBlockEvent {
+ attack_block_events.write(AttackBlockEvent {
entity: event.entity,
position: event.position,
});
@@ -303,7 +303,7 @@ fn handle_start_mining_block_with_direction_event(
) >= 1.
{
// block was broken instantly
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity: event.entity,
position: event.position,
});
@@ -316,7 +316,7 @@ fn handle_start_mining_block_with_direction_event(
**current_mining_item = held_item;
**mine_progress = 0.;
**mine_ticks = 0.;
- mine_block_progress_events.send(MineBlockProgressEvent {
+ mine_block_progress_events.write(MineBlockProgressEvent {
entity: event.entity,
position: event.position,
destroy_stage: mine_progress.destroy_stage(),
@@ -502,7 +502,7 @@ pub fn handle_stop_mining_block_event(
));
commands.entity(event.entity).remove::<Mining>();
**mine_progress = 0.;
- mine_block_progress_events.send(MineBlockProgressEvent {
+ mine_block_progress_events.write(MineBlockProgressEvent {
entity: event.entity,
position: mine_block_pos,
destroy_stage: None,
@@ -558,7 +558,7 @@ pub fn continue_mining_block(
if game_mode.current == GameMode::Creative {
// TODO: worldborder check
**mine_delay = 5;
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity,
position: mining.pos,
});
@@ -572,7 +572,7 @@ pub fn continue_mining_block(
sequence: **sequence_number,
},
));
- swing_arm_events.send(SwingArmEvent { entity });
+ swing_arm_events.write(SwingArmEvent { entity });
} else if is_same_mining_target(
mining.pos,
inventory,
@@ -604,7 +604,7 @@ pub fn continue_mining_block(
if **mine_progress >= 1. {
commands.entity(entity).remove::<Mining>();
*sequence_number += 1;
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity,
position: mining.pos,
});
@@ -622,20 +622,20 @@ pub fn continue_mining_block(
**mine_delay = 0;
}
- mine_block_progress_events.send(MineBlockProgressEvent {
+ mine_block_progress_events.write(MineBlockProgressEvent {
entity,
position: mining.pos,
destroy_stage: mine_progress.destroy_stage(),
});
- swing_arm_events.send(SwingArmEvent { entity });
+ swing_arm_events.write(SwingArmEvent { entity });
} else {
- start_mining_events.send(StartMiningBlockWithDirectionEvent {
+ start_mining_events.write(StartMiningBlockWithDirectionEvent {
entity,
position: mining.pos,
direction: mining.dir,
});
}
- swing_arm_events.send(SwingArmEvent { entity });
+ swing_arm_events.write(SwingArmEvent { entity });
}
}
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index f45ead9c..2d844064 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -17,13 +17,7 @@ use azalea_protocol::packets::{
};
use azalea_world::{MinecraftEntityId, MoveEntityError};
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::prelude::Event;
-use bevy_ecs::schedule::SystemSet;
-use bevy_ecs::system::Commands;
-use bevy_ecs::{
- component::Component, entity::Entity, event::EventReader, query::With,
- schedule::IntoSystemConfigs, system::Query,
-};
+use bevy_ecs::prelude::*;
use thiserror::Error;
use crate::client::Client;
diff --git a/azalea-client/src/plugins/packet/config/mod.rs b/azalea-client/src/plugins/packet/config/mod.rs
index 9560703b..554135d2 100644
--- a/azalea-client/src/plugins/packet/config/mod.rs
+++ b/azalea-client/src/plugins/packet/config/mod.rs
@@ -82,7 +82,7 @@ impl ConfigPacketHandler<'_> {
pub fn disconnect(&mut self, p: &ClientboundDisconnect) {
warn!("Got disconnect packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(DisconnectEvent {
+ events.write(DisconnectEvent {
entity: self.player,
reason: Some(p.reason.clone()),
});
@@ -124,7 +124,7 @@ impl ConfigPacketHandler<'_> {
);
as_system::<(Commands, EventWriter<_>)>(self.ecs, |(mut commands, mut events)| {
- events.send(KeepAliveEvent {
+ events.write(KeepAliveEvent {
entity: self.player,
id: p.id,
});
@@ -147,7 +147,7 @@ impl ConfigPacketHandler<'_> {
debug!("Got resource pack push packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ResourcePackEvent {
+ events.write(ResourcePackEvent {
entity: self.player,
id: p.id,
url: p.url.to_owned(),
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index 6235eafd..869a795c 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -249,7 +249,7 @@ impl GamePacketHandler<'_> {
dimension_data.min_y,
&instance_holder.instance.read().registries,
);
- instance_loaded_events.send(InstanceLoadedEvent {
+ instance_loaded_events.write(InstanceLoadedEvent {
entity: self.player,
name: new_instance_name.clone(),
instance: Arc::downgrade(&weak_instance),
@@ -339,7 +339,7 @@ impl GamePacketHandler<'_> {
debug!("Got chunk batch start");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(chunks::ChunkBatchStartEvent {
+ events.write(chunks::ChunkBatchStartEvent {
entity: self.player,
});
});
@@ -349,7 +349,7 @@ impl GamePacketHandler<'_> {
debug!("Got chunk batch finished {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(chunks::ChunkBatchFinishedEvent {
+ events.write(chunks::ChunkBatchFinishedEvent {
entity: self.player,
batch_size: p.batch_size,
});
@@ -390,7 +390,7 @@ impl GamePacketHandler<'_> {
warn!("Got disconnect packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(DisconnectEvent {
+ events.write(DisconnectEvent {
entity: self.player,
reason: Some(p.reason.clone()),
});
@@ -532,7 +532,7 @@ impl GamePacketHandler<'_> {
display_name: updated_info.display_name.clone(),
};
tab_list.insert(updated_info.profile.uuid, info.clone());
- add_player_events.send(AddPlayerEvent {
+ add_player_events.write(AddPlayerEvent {
entity: self.player,
info,
});
@@ -548,7 +548,7 @@ impl GamePacketHandler<'_> {
if p.actions.update_display_name {
info.display_name.clone_from(&updated_info.display_name);
}
- update_player_events.send(UpdatePlayerEvent {
+ update_player_events.write(UpdatePlayerEvent {
entity: self.player,
info: info.clone(),
});
@@ -577,7 +577,7 @@ impl GamePacketHandler<'_> {
for uuid in &p.profile_ids {
if let Some(info) = tab_list.remove(uuid) {
- remove_player_events.send(RemovePlayerEvent {
+ remove_player_events.write(RemovePlayerEvent {
entity: self.player,
info,
});
@@ -611,7 +611,7 @@ impl GamePacketHandler<'_> {
debug!("Got chunk with light packet {} {}", p.x, p.z);
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(chunks::ReceiveChunkEvent {
+ events.write(chunks::ReceiveChunkEvent {
entity: self.player,
packet: p.clone(),
});
@@ -1032,7 +1032,7 @@ impl GamePacketHandler<'_> {
as_system::<(EventWriter<KeepAliveEvent>, Commands)>(
self.ecs,
|(mut keepalive_events, mut commands)| {
- keepalive_events.send(KeepAliveEvent {
+ keepalive_events.write(KeepAliveEvent {
entity: self.player,
id: p.id,
});
@@ -1084,7 +1084,7 @@ impl GamePacketHandler<'_> {
debug!("Got player chat packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ChatReceivedEvent {
+ events.write(ChatReceivedEvent {
entity: self.player,
packet: ChatPacket::Player(Arc::new(p.clone())),
});
@@ -1095,7 +1095,7 @@ impl GamePacketHandler<'_> {
debug!("Got system chat packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ChatReceivedEvent {
+ events.write(ChatReceivedEvent {
entity: self.player,
packet: ChatPacket::System(Arc::new(p.clone())),
});
@@ -1106,7 +1106,7 @@ impl GamePacketHandler<'_> {
debug!("Got disguised chat packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ChatReceivedEvent {
+ events.write(ChatReceivedEvent {
entity: self.player,
packet: ChatPacket::Disguised(Arc::new(p.clone())),
});
@@ -1217,7 +1217,7 @@ impl GamePacketHandler<'_> {
}
}
} else {
- events.send(SetContainerContentEvent {
+ events.write(SetContainerContentEvent {
entity: self.player,
slots: p.items.clone(),
container_id: p.container_id,
@@ -1283,7 +1283,7 @@ impl GamePacketHandler<'_> {
debug!("Got container close packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ClientSideCloseContainerEvent {
+ events.write(ClientSideCloseContainerEvent {
entity: self.player,
});
});
@@ -1300,7 +1300,7 @@ impl GamePacketHandler<'_> {
as_system::<EventWriter<_>>(self.ecs, |mut knockback_events| {
if let Some(knockback) = p.knockback {
- knockback_events.send(KnockbackEvent {
+ knockback_events.write(KnockbackEvent {
entity: self.player,
knockback: KnockbackType::Set(knockback),
});
@@ -1334,7 +1334,7 @@ impl GamePacketHandler<'_> {
debug!("Got open screen packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(MenuOpenedEvent {
+ events.write(MenuOpenedEvent {
entity: self.player,
window_id: p.container_id,
menu_type: p.menu_type,
@@ -1371,7 +1371,7 @@ impl GamePacketHandler<'_> {
if *entity_id == p.player_id && dead.is_none() {
commands.entity(self.player).insert(Dead);
- events.send(DeathEvent {
+ events.write(DeathEvent {
entity: self.player,
packet: Some(p.clone()),
});
@@ -1387,7 +1387,7 @@ impl GamePacketHandler<'_> {
debug!("Got resource pack packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ResourcePackEvent {
+ events.write(ResourcePackEvent {
entity: self.player,
id: p.id,
url: p.url.to_owned(),
@@ -1439,7 +1439,7 @@ impl GamePacketHandler<'_> {
dimension_data.min_y,
&instance_holder.instance.read().registries,
);
- events.send(InstanceLoadedEvent {
+ events.write(InstanceLoadedEvent {
entity: self.player,
name: new_instance_name.clone(),
instance: Arc::downgrade(&weak_instance),
diff --git a/azalea-client/src/plugins/packet/login/mod.rs b/azalea-client/src/plugins/packet/login/mod.rs
index d313a767..3dad17ab 100644
--- a/azalea-client/src/plugins/packet/login/mod.rs
+++ b/azalea-client/src/plugins/packet/login/mod.rs
@@ -72,7 +72,7 @@ impl LoginPacketHandler<'_> {
debug!("Got disconnect {:?}", p);
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(DisconnectEvent {
+ events.write(DisconnectEvent {
entity: self.player,
reason: Some(p.reason.clone()),
});
@@ -121,7 +121,7 @@ impl LoginPacketHandler<'_> {
debug!("Got custom query {p:?}");
as_system::<EventWriter<ReceiveCustomQueryEvent>>(self.ecs, |mut events| {
- events.send(ReceiveCustomQueryEvent {
+ events.write(ReceiveCustomQueryEvent {
entity: self.player,
packet: p.clone(),
disabled: false,
diff --git a/azalea-client/src/plugins/packet/mod.rs b/azalea-client/src/plugins/packet/mod.rs
index 1c14fa30..0abf43cc 100644
--- a/azalea-client/src/plugins/packet/mod.rs
+++ b/azalea-client/src/plugins/packet/mod.rs
@@ -20,7 +20,7 @@ pub fn death_event_on_0_health(
) {
for (entity, health) in query.iter() {
if **health == 0. {
- death_events.send(DeathEvent {
+ death_events.write(DeathEvent {
entity,
packet: None,
});
diff --git a/azalea-client/src/plugins/pong.rs b/azalea-client/src/plugins/pong.rs
index 827ddfb1..e23b5245 100644
--- a/azalea-client/src/plugins/pong.rs
+++ b/azalea-client/src/plugins/pong.rs
@@ -24,14 +24,14 @@ impl Plugin for PongPlugin {
pub fn reply_to_game_ping(trigger: Trigger<PingEvent>, mut commands: Commands) {
commands.trigger(SendPacketEvent::new(
- trigger.entity(),
+ trigger.target(),
azalea_protocol::packets::game::ServerboundPong { id: trigger.0.id },
));
}
pub fn reply_to_config_ping(trigger: Trigger<ConfigPingEvent>, mut commands: Commands) {
commands.trigger(SendConfigPacketEvent::new(
- trigger.entity(),
+ trigger.target(),
azalea_protocol::packets::config::ServerboundPong { id: trigger.0.id },
));
}
diff --git a/azalea-client/src/plugins/task_pool.rs b/azalea-client/src/plugins/task_pool.rs
index ab56bf69..56ebc7cf 100644
--- a/azalea-client/src/plugins/task_pool.rs
+++ b/azalea-client/src/plugins/task_pool.rs
@@ -3,7 +3,7 @@
use std::marker::PhantomData;
use bevy_app::{App, Last, Plugin};
-use bevy_ecs::system::{NonSend, Resource};
+use bevy_ecs::prelude::*;
use bevy_tasks::{
AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, TaskPoolBuilder,
tick_global_task_pools_on_main_thread,
diff --git a/azalea-client/src/test_simulation.rs b/azalea-client/src/test_simulation.rs
index 4dec01b4..53e4110e 100644
--- a/azalea-client/src/test_simulation.rs
+++ b/azalea-client/src/test_simulation.rs
@@ -20,6 +20,7 @@ use azalea_registry::{DimensionType, EntityKind};
use azalea_world::palette::{PalettedContainer, PalettedContainerKind};
use azalea_world::{Chunk, Instance, MinecraftEntityId, Section};
use bevy_app::App;
+use bevy_ecs::component::Mutable;
use bevy_ecs::{prelude::*, schedule::ExecutorKind};
use parking_lot::RwLock;
use simdnbt::owned::{NbtCompound, NbtTag};
@@ -109,7 +110,10 @@ impl Simulation {
pub fn has_component<T: Component>(&self) -> bool {
self.app.world().get::<T>(self.entity).is_some()
}
- pub fn with_component_mut<T: Component>(&mut self, f: impl FnOnce(&mut T)) {
+ pub fn with_component_mut<T: Component<Mutability = Mutable>>(
+ &mut self,
+ f: impl FnOnce(&mut T),
+ ) {
f(&mut self
.app
.world_mut()