Skip to main content

azalea/
lib.rs

1#![doc = include_str!("../README.md")]
2#![feature(type_changing_struct_update)]
3
4#[cfg(doc)]
5pub mod _docs;
6pub mod accept_resource_packs;
7pub mod auto_reconnect;
8pub mod auto_respawn;
9pub mod auto_tool;
10pub mod bot;
11mod builder;
12mod client_impl;
13pub mod container;
14mod entity_ref;
15pub mod events;
16mod join_opts;
17pub mod nearest_entity;
18pub mod pathfinder;
19pub mod prelude;
20pub mod swarm;
21pub mod tick_broadcast;
22
23pub use azalea_auth as auth;
24pub use azalea_block as block;
25#[doc(hidden)]
26#[deprecated = "moved to `azalea::block`"]
27pub mod blocks {
28    pub type BlockStates = azalea_block::BlockStates;
29    pub type BlockState = azalea_block::BlockState;
30    pub trait BlockTrait: azalea_block::BlockTrait {}
31    // azalea_block has more items but rust doesn't mark them deprecated if we
32    // `use azalea_block::*`, so hopefully the three types above are enough for
33    // most users :(
34}
35
36pub use azalea_brigadier as brigadier;
37pub use azalea_buf as buf;
38pub use azalea_chat::FormattedText;
39pub use azalea_client::*;
40pub use azalea_core as core;
41// these are re-exported on this level because they're very common
42pub use azalea_core::position::{BlockPos, Vec3};
43pub use azalea_entity as entity;
44pub use azalea_physics as physics;
45pub use azalea_protocol as protocol;
46pub use azalea_registry as registry;
47#[doc(hidden)]
48#[deprecated(note = "renamed to `Identifier`.")]
49pub type ResourceLocation = azalea_registry::identifier::Identifier;
50pub use azalea_registry::identifier::Identifier;
51pub use azalea_world as world;
52pub use bevy_app as app;
53pub use bevy_ecs as ecs;
54use bevy_ecs::component::Component;
55pub use builder::ClientBuilder;
56use futures::future::BoxFuture;
57pub use join_opts::JoinOpts;
58
59pub use crate::{client_impl::Client, entity_ref::EntityRef, events::Event};
60
61pub type BoxHandleFn<S, R> = Box<dyn Fn(Client, Event, S) -> BoxFuture<'static, R> + Send>;
62pub type HandleFn<S, Fut> = fn(Client, Event, S) -> Fut;
63
64/// A marker that can be used in place of a State in [`ClientBuilder`] or
65/// [`SwarmBuilder`].
66///
67/// You probably don't need to use this manually since the compiler will infer
68/// it for you.
69///
70/// [`SwarmBuilder`]: swarm::SwarmBuilder
71#[derive(Clone, Component, Default)]
72pub struct NoState;