diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-12-04 23:42:49 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-04 23:42:49 -0600 |
| commit | 421d8ce2c837e3140d8f866e63032c277b31a413 (patch) | |
| tree | d5f06fbcd02c24c6b40edd22cbdfda4d6ed6a39f /azalea/src/pathfinder/simulation.rs | |
| parent | da4afa8ae3afec4cd59b9a19ae1e04818f1763a7 (diff) | |
| download | azalea-drasl-421d8ce2c837e3140d8f866e63032c277b31a413.tar.xz | |
Replace Bevy's FixedUpdate with Azalea's GameTick (#119)
* replace bevy FixedUpdate with azalea GameTick
* Update to Bevy 0.12.1
Diffstat (limited to 'azalea/src/pathfinder/simulation.rs')
| -rw-r--r-- | azalea/src/pathfinder/simulation.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index c6fe096f..88261b7f 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -1,19 +1,18 @@ //! Simulate the Minecraft world, currently only used for tests. -use std::{sync::Arc, time::Duration}; +use std::sync::Arc; use azalea_client::{ inventory::InventoryComponent, packet_handling::game::SendPacketEvent, PhysicsState, }; -use azalea_core::{position::Vec3, resource_location::ResourceLocation}; +use azalea_core::{position::Vec3, resource_location::ResourceLocation, tick::GameTick}; use azalea_entity::{ attributes::AttributeInstance, metadata::Sprinting, Attributes, EntityDimensions, Physics, Position, }; use azalea_world::{ChunkStorage, Instance, InstanceContainer, InstanceName, MinecraftEntityId}; -use bevy_app::{App, FixedUpdate}; +use bevy_app::App; use bevy_ecs::prelude::*; -use bevy_time::{Fixed, Time}; use parking_lot::RwLock; #[derive(Bundle, Clone)] @@ -71,8 +70,6 @@ impl Simulation { crate::BotPlugin, azalea_client::task_pool::TaskPoolPlugin::default(), )) - // make sure it doesn't do fixed ticks without us telling it to - .insert_resource(Time::<Fixed>::from_duration(Duration::MAX)) .insert_resource(InstanceContainer { instances: [(instance_name.clone(), Arc::downgrade(&instance.clone()))] .iter() @@ -107,7 +104,7 @@ impl Simulation { } } pub fn tick(&mut self) { - self.app.world.run_schedule(FixedUpdate); + self.app.world.run_schedule(GameTick); self.app.update(); } pub fn position(&self) -> Vec3 { |
