mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
fix all the tests
This commit is contained in:
parent
8415aaccfe
commit
27fce90682
5 changed files with 11 additions and 12 deletions
|
@ -40,7 +40,7 @@ async fn main() {
|
|||
if sender == client.profile.name {
|
||||
continue; // ignore our own messages
|
||||
}
|
||||
client.chat(&content).await;
|
||||
client.chat(&content);
|
||||
};
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -150,7 +150,7 @@ impl Client {
|
|||
/// ```rust,no_run
|
||||
/// # use azalea_client::{Client, Event};
|
||||
/// # async fn handle(bot: Client, event: Event) -> anyhow::Result<()> {
|
||||
/// bot.chat("Hello, world!").await.unwrap();
|
||||
/// bot.chat("Hello, world!");
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
|
|
|
@ -27,13 +27,19 @@ impl Client {
|
|||
/// # Example
|
||||
/// Note that this will very likely change in the future.
|
||||
/// ```
|
||||
/// use azalea_client::{Client, GameProfileComponent};
|
||||
/// use azalea_ecs::query::With;
|
||||
/// use azalea_world::entity::{Position, metadata::Player};
|
||||
///
|
||||
/// # fn example(mut bot: Client, sender_name: String) {
|
||||
/// let entity = bot.entity_by::<With<Player>, (&GameProfileComponent,)>(
|
||||
/// |profile: &&GameProfileComponent| profile.name == sender,
|
||||
/// |profile: &&GameProfileComponent| profile.name == sender_name,
|
||||
/// );
|
||||
/// if let Some(entity) = entity {
|
||||
/// let position = bot.entity_component::<Position>(entity);
|
||||
/// // ...
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
pub fn entity_by<F: ReadOnlyWorldQuery, Q: ReadOnlyWorldQuery>(
|
||||
&mut self,
|
||||
|
|
|
@ -12,10 +12,7 @@
|
|||
//! - Rename bevy_ecs::world::World to azalea_ecs::ecs::Ecs
|
||||
//! - Re-export `bevy_app` in the `app` module.
|
||||
|
||||
use std::{
|
||||
task::{Context, Poll},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
pub mod ecs {
|
||||
pub use bevy_ecs::world::World as Ecs;
|
||||
|
@ -91,9 +88,7 @@ pub struct TickStage {
|
|||
impl Stage for TickStage {
|
||||
fn run(&mut self, ecs: &mut Ecs) {
|
||||
// if the interval is 0, that means it runs every tick
|
||||
println!("running tick stage maybe");
|
||||
if self.interval.is_zero() {
|
||||
println!("running tick stage");
|
||||
self.stage.run(ecs);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -312,7 +312,6 @@ mod tests {
|
|||
entity::{EntityBundle, MinecraftEntityId},
|
||||
Chunk, EntityPlugin, PartialWorld,
|
||||
};
|
||||
use iyes_loopless::fixedtimestep::FixedTimestepStageLabel;
|
||||
use parking_lot::RwLock;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -331,12 +330,11 @@ mod tests {
|
|||
#[test]
|
||||
fn test_gravity() {
|
||||
let mut app = make_test_app();
|
||||
let world_lock = app.world.resource_mut::<WorldContainer>().insert(
|
||||
let _world_lock = app.world.resource_mut::<WorldContainer>().insert(
|
||||
ResourceLocation::new("minecraft:overworld").unwrap(),
|
||||
384,
|
||||
-64,
|
||||
);
|
||||
let mut partial_world = PartialWorld::default();
|
||||
|
||||
let entity = app
|
||||
.world
|
||||
|
|
Loading…
Add table
Reference in a new issue