aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder
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/src/pathfinder
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/src/pathfinder')
-rw-r--r--azalea/src/pathfinder/mod.rs2
-rw-r--r--azalea/src/pathfinder/simulation.rs16
2 files changed, 9 insertions, 9 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 88ae5da0..eab07348 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -875,7 +875,7 @@ mod tests {
// filter: "".to_string(),
// });
- simulation.app.world.send_event(GotoEvent {
+ simulation.app.world_mut().send_event(GotoEvent {
entity: simulation.entity,
goal: Arc::new(BlockPosGoal(end_pos)),
successors_fn: moves::default_move,
diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs
index ae76896c..ca15fb7a 100644
--- a/azalea/src/pathfinder/simulation.rs
+++ b/azalea/src/pathfinder/simulation.rs
@@ -130,7 +130,7 @@ pub struct Simulation {
impl Simulation {
pub fn new(chunks: ChunkStorage, player: SimulatedPlayerBundle) -> Self {
let (mut app, instance) = create_simulation_instance(chunks);
- let entity = create_simulation_player(&mut app.world, instance.clone(), player);
+ let entity = create_simulation_player(app.world_mut(), instance.clone(), player);
Self {
app,
entity,
@@ -140,13 +140,13 @@ impl Simulation {
pub fn tick(&mut self) {
self.app.update();
- self.app.world.run_schedule(GameTick);
+ self.app.world_mut().run_schedule(GameTick);
}
pub fn component<T: Component + Clone>(&self) -> T {
- self.app.world.get::<T>(self.entity).unwrap().clone()
+ self.app.world().get::<T>(self.entity).unwrap().clone()
}
pub fn get_component<T: Component + Clone>(&self) -> Option<T> {
- self.app.world.get::<T>(self.entity).cloned()
+ self.app.world().get::<T>(self.entity).cloned()
}
pub fn position(&self) -> Vec3 {
*self.component::<Position>()
@@ -171,17 +171,17 @@ impl SimulationSet {
}
pub fn tick(&mut self) {
self.app.update();
- self.app.world.run_schedule(GameTick);
+ self.app.world_mut().run_schedule(GameTick);
}
pub fn spawn(&mut self, player: SimulatedPlayerBundle) -> Entity {
- create_simulation_player(&mut self.app.world, self.instance.clone(), player)
+ create_simulation_player(self.app.world_mut(), self.instance.clone(), player)
}
pub fn despawn(&mut self, entity: Entity) {
- self.app.world.despawn(entity);
+ self.app.world_mut().despawn(entity);
}
pub fn position(&self, entity: Entity) -> Vec3 {
- **self.app.world.get::<Position>(entity).unwrap()
+ **self.app.world().get::<Position>(entity).unwrap()
}
}