diff options
Diffstat (limited to 'azalea/src')
| -rw-r--r-- | azalea/src/pathfinder/simulation.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index a5e8113f..2803b846 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -87,14 +87,13 @@ fn create_simulation_instance(chunks: ChunkStorage) -> (App, Arc<RwLock<Instance (app, instance) } -fn create_simulation_player( - ecs: &mut World, +fn create_simulation_player_complete_bundle( instance: Arc<RwLock<Instance>>, - player: SimulatedPlayerBundle, -) -> Entity { + player: &SimulatedPlayerBundle, +) -> impl Bundle { let instance_name = simulation_instance_name(); - let mut entity = ecs.spawn(( + ( MinecraftEntityId(0), azalea_entity::LocalEntity, azalea_entity::metadata::PlayerMetadataBundle::default(), @@ -110,9 +109,16 @@ fn create_simulation_player( instance: instance.clone(), }, InventoryComponent::default(), - )); - entity.insert(player); + ) +} +fn create_simulation_player( + ecs: &mut World, + instance: Arc<RwLock<Instance>>, + player: SimulatedPlayerBundle, +) -> Entity { + let mut entity = ecs.spawn(create_simulation_player_complete_bundle(instance, &player)); + entity.insert(player); entity.id() } |
