diff options
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/client.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 4d803994..2ebf44b5 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -30,7 +30,7 @@ use azalea_protocol::{ resolver, }; use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId, PartialInstance}; -use bevy_app::{App, Plugin, PluginsState, Update}; +use bevy_app::{App, Plugin, PluginsState, SubApp, Update}; use bevy_ecs::{ prelude::*, schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings}, @@ -126,7 +126,7 @@ impl<'a> StartClientOpts<'a> { let mut app = App::new(); app.add_plugins(DefaultPlugins); - let (ecs_lock, start_running_systems) = start_ecs_runner(app); + let (ecs_lock, start_running_systems) = start_ecs_runner(app.main_mut()); start_running_systems(); Self { @@ -667,7 +667,7 @@ impl Plugin for AzaleaPlugin { /// You can create your app with `App::new()`, but don't forget to add /// [`DefaultPlugins`]. #[doc(hidden)] -pub fn start_ecs_runner(mut app: App) -> (Arc<Mutex<World>>, impl FnOnce()) { +pub fn start_ecs_runner(app: &mut SubApp) -> (Arc<Mutex<World>>, impl FnOnce()) { // this block is based on Bevy's default runner: // https://github.com/bevyengine/bevy/blob/390877cdae7a17095a75c8f9f1b4241fe5047e83/crates/bevy_app/src/schedule_runner.rs#L77-L85 if app.plugins_state() != PluginsState::Cleaned { @@ -688,7 +688,7 @@ pub fn start_ecs_runner(mut app: App) -> (Arc<Mutex<World>>, impl FnOnce()) { let ecs = Arc::new(Mutex::new(mem::take(app.world_mut()))); let ecs_clone = ecs.clone(); - let outer_schedule_label = *app.main().update_schedule.as_ref().unwrap(); + let outer_schedule_label = *app.update_schedule.as_ref().unwrap(); let start_running_systems = move || { tokio::spawn(run_schedule_loop(ecs_clone, outer_schedule_label)); }; |
