aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-client/src')
-rw-r--r--azalea-client/src/client.rs6
-rw-r--r--azalea-client/src/local_player.rs2
-rw-r--r--azalea-client/src/packet_handling/game.rs12
3 files changed, 10 insertions, 10 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 5158eedf..57bf878b 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -728,17 +728,17 @@ impl Plugin for AzaleaPlugin {
/// [`DefaultPlugins`].
#[doc(hidden)]
pub fn start_ecs_runner(
- app: App,
+ mut app: App,
run_schedule_receiver: mpsc::UnboundedReceiver<()>,
run_schedule_sender: mpsc::UnboundedSender<()>,
) -> Arc<Mutex<World>> {
// all resources should have been added by now so we can take the ecs from the
// app
- let ecs = Arc::new(Mutex::new(app.world));
+ let ecs = Arc::new(Mutex::new(std::mem::take(app.world_mut())));
tokio::spawn(run_schedule_loop(
ecs.clone(),
- app.main_schedule_label,
+ *app.main().update_schedule.as_ref().unwrap(),
run_schedule_receiver,
));
tokio::spawn(tick_run_schedule_loop(run_schedule_sender));
diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs
index d2fce3f1..c01dcef6 100644
--- a/azalea-client/src/local_player.rs
+++ b/azalea-client/src/local_player.rs
@@ -137,8 +137,8 @@ pub fn death_event(query: Query<&LocalPlayerEvents, Added<Dead>>) {
}
}
-#[allow(clippy::large_enum_variant)]
#[derive(Error, Debug)]
+#[expect(clippy::large_enum_variant)]
pub enum HandlePacketError {
#[error("{0}")]
Poison(String),
diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs
index 38178a63..e9be45c7 100644
--- a/azalea-client/src/packet_handling/game.rs
+++ b/azalea-client/src/packet_handling/game.rs
@@ -730,7 +730,7 @@ pub fn process_packet_events(ecs: &mut World) {
// we use RelativeEntityUpdate because it makes sure changes aren't made
// multiple times
- commands.entity(entity).add(RelativeEntityUpdate {
+ commands.entity(entity).queue(RelativeEntityUpdate {
partial_world: instance_holder.partial_instance.clone(),
update: Box::new(move |entity| {
let entity_id = entity.id();
@@ -781,7 +781,7 @@ pub fn process_packet_events(ecs: &mut World) {
z: p.za as f64 / 8000.,
});
- commands.entity(entity).add(RelativeEntityUpdate {
+ commands.entity(entity).queue(RelativeEntityUpdate {
partial_world: instance_holder.partial_instance.clone(),
update: Box::new(move |entity_mut| {
entity_mut.world_scope(|world| {
@@ -838,7 +838,7 @@ pub fn process_packet_events(ecs: &mut World) {
x_rot: (p.x_rot as i32 * 360) as f32 / 256.,
y_rot: (p.y_rot as i32 * 360) as f32 / 256.,
};
- commands.entity(entity).add(RelativeEntityUpdate {
+ commands.entity(entity).queue(RelativeEntityUpdate {
partial_world: instance_holder.partial_instance.clone(),
update: Box::new(move |entity| {
let mut position = entity.get_mut::<Position>().unwrap();
@@ -875,7 +875,7 @@ pub fn process_packet_events(ecs: &mut World) {
if let Some(entity) = entity {
let delta = p.delta.clone();
- commands.entity(entity).add(RelativeEntityUpdate {
+ commands.entity(entity).queue(RelativeEntityUpdate {
partial_world: instance_holder.partial_instance.clone(),
update: Box::new(move |entity_mut| {
let mut position = entity_mut.get_mut::<Position>().unwrap();
@@ -911,7 +911,7 @@ pub fn process_packet_events(ecs: &mut World) {
y_rot: (p.y_rot as i32 * 360) as f32 / 256.,
};
- commands.entity(entity).add(RelativeEntityUpdate {
+ commands.entity(entity).queue(RelativeEntityUpdate {
partial_world: instance_holder.partial_instance.clone(),
update: Box::new(move |entity_mut| {
let mut position = entity_mut.get_mut::<Position>().unwrap();
@@ -951,7 +951,7 @@ pub fn process_packet_events(ecs: &mut World) {
y_rot: (p.y_rot as i32 * 360) as f32 / 256.,
};
- commands.entity(entity).add(RelativeEntityUpdate {
+ commands.entity(entity).queue(RelativeEntityUpdate {
partial_world: instance_holder.partial_instance.clone(),
update: Box::new(move |entity_mut| {
let mut look_direction = entity_mut.get_mut::<LookDirection>().unwrap();