mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
async_fn_in_trait stabilized
This commit is contained in:
parent
97ec9f7c7d
commit
252958bb90
3 changed files with 7 additions and 3 deletions
|
@ -21,6 +21,7 @@ use azalea_physics::PhysicsSet;
|
||||||
use bevy_app::{FixedUpdate, Update};
|
use bevy_app::{FixedUpdate, Update};
|
||||||
use bevy_ecs::prelude::Event;
|
use bevy_ecs::prelude::Event;
|
||||||
use bevy_ecs::schedule::IntoSystemConfigs;
|
use bevy_ecs::schedule::IntoSystemConfigs;
|
||||||
|
use futures_lite::Future;
|
||||||
use log::trace;
|
use log::trace;
|
||||||
use std::f64::consts::PI;
|
use std::f64::consts::PI;
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ pub trait BotClientExt {
|
||||||
/// that's necessary you'll have to do that yourself with [`look_at`].
|
/// that's necessary you'll have to do that yourself with [`look_at`].
|
||||||
///
|
///
|
||||||
/// [`look_at`]: crate::prelude::BotClientExt::look_at
|
/// [`look_at`]: crate::prelude::BotClientExt::look_at
|
||||||
async fn mine(&mut self, position: BlockPos);
|
fn mine(&mut self, position: BlockPos) -> impl Future<Output = ()> + Send;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BotClientExt for azalea_client::Client {
|
impl BotClientExt for azalea_client::Client {
|
||||||
|
|
|
@ -10,6 +10,7 @@ use azalea_inventory::{operations::ClickOperation, ItemSlot, Menu};
|
||||||
use azalea_protocol::packets::game::ClientboundGamePacket;
|
use azalea_protocol::packets::game::ClientboundGamePacket;
|
||||||
use bevy_app::{App, Plugin, Update};
|
use bevy_app::{App, Plugin, Update};
|
||||||
use bevy_ecs::{component::Component, prelude::EventReader, system::Commands};
|
use bevy_ecs::{component::Component, prelude::EventReader, system::Commands};
|
||||||
|
use futures_lite::Future;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use crate::bot::BotClientExt;
|
use crate::bot::BotClientExt;
|
||||||
|
@ -22,7 +23,10 @@ impl Plugin for ContainerPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ContainerClientExt {
|
pub trait ContainerClientExt {
|
||||||
async fn open_container(&mut self, pos: BlockPos) -> Option<ContainerHandle>;
|
fn open_container(
|
||||||
|
&mut self,
|
||||||
|
pos: BlockPos,
|
||||||
|
) -> impl Future<Output = Option<ContainerHandle>> + Send;
|
||||||
fn open_inventory(&mut self) -> Option<ContainerHandle>;
|
fn open_inventory(&mut self) -> Option<ContainerHandle>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
#![feature(async_closure)]
|
#![feature(async_closure)]
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
#![feature(async_fn_in_trait)]
|
|
||||||
#![feature(type_changing_struct_update)]
|
#![feature(type_changing_struct_update)]
|
||||||
#![feature(lazy_cell)]
|
#![feature(lazy_cell)]
|
||||||
#![feature(let_chains)]
|
#![feature(let_chains)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue