diff options
| author | mat <git@matdoes.dev> | 2023-09-13 19:56:28 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-09-13 19:56:28 -0500 |
| commit | dea4a656a574318fc011e0545046b0d78b0e816e (patch) | |
| tree | e60b54f433335b32c9b4e7ab40b691e478781b74 /azalea-physics/src | |
| parent | 9fa6957fa1eda2ae4b94dd381e21794b5b13f687 (diff) | |
| download | azalea-drasl-dea4a656a574318fc011e0545046b0d78b0e816e.tar.xz | |
fix tests
Diffstat (limited to 'azalea-physics/src')
| -rw-r--r-- | azalea-physics/src/lib.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 143f99ab..5a2b896c 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -351,11 +351,18 @@ mod tests { #[test] fn test_gravity() { let mut app = make_test_app(); - let _world_lock = app.world.resource_mut::<InstanceContainer>().insert( + let world_lock = app.world.resource_mut::<InstanceContainer>().insert( ResourceLocation::new("minecraft:overworld"), 384, -64, ); + let mut partial_world = PartialInstance::default(); + // the entity has to be in a loaded chunk for physics to work + partial_world.chunks.set( + &ChunkPos { x: 0, z: 0 }, + Some(Chunk::default()), + &mut world_lock.write().chunks, + ); let entity = app .world @@ -379,6 +386,7 @@ mod tests { // y should start at 70 assert_eq!(entity_pos.y, 70.); } + app.update(); app.world.run_schedule(FixedUpdate); app.update(); { @@ -441,6 +449,7 @@ mod tests { block_state.is_some(), "Block state should exist, if this fails that means the chunk wasn't loaded and the block didn't get placed" ); + app.update(); app.world.run_schedule(FixedUpdate); app.update(); { |
