aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src
diff options
context:
space:
mode:
authorEightFactorial <29801334+EightFactorial@users.noreply.github.com>2024-12-04 16:31:22 -0800
committerGitHub <noreply@github.com>2024-12-04 18:31:22 -0600
commit6379035b852f1b619565d27f5cee3b93042c2312 (patch)
tree30c858cfaf841d0fcc5a139f1507b9b67d768e8b /azalea-client/src
parent241c7527ce11177082dcc0ebc4152506946ee684 (diff)
downloadazalea-drasl-6379035b852f1b619565d27f5cee3b93042c2312.tar.xz
Update Bevy and migrate to workspace dependencies and package attributes (#181)
* Use workspace `Cargo.toml` for dependencies and package atributes * Fix a couple clippy warnings * Update bevy, update build script, move deps to workspace, and fix clippy warnings * Remove carrots from crate versions The default behavior is the same * Remove unused dependencies Compiles and all tests pass, so it should be fine * Update codegen to use `std::sync::LazyLock` instead of `once_cell::sync::Lazy` * Update Bevy to `0.15.0-rc.3` Surprisingly little needed to be changed * Update to bevy 0.15.0 * Fix leftover merge issues * Clarify the reason the swarm can't connect * Fix duplicate lint, remove `log` dependency
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();