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_chat as chat;
51pub use azalea_registry::identifier::Identifier;
52pub use azalea_world as world;
53pub use bevy_app as app;
54pub use bevy_ecs as ecs;
55use bevy_ecs::component::Component;
56pub use builder::ClientBuilder;
57use futures::future::BoxFuture;
58pub use join_opts::JoinOpts;
59
60pub use crate::{
61    client_impl::{Client, StartClientOpts},
62    entity_ref::EntityRef,
63    events::Event,
64};
65
66pub type BoxHandleFn<S, R> = Box<dyn Fn(Client, Event, S) -> BoxFuture<'static, R> + Send>;
67pub type HandleFn<S, Fut> = fn(Client, Event, S) -> Fut;
68
69/// A marker that can be used in place of a State in [`ClientBuilder`] or
70/// [`SwarmBuilder`].
71///
72/// You probably don't need to use this manually since the compiler will infer
73/// it for you.
74///
75/// [`SwarmBuilder`]: swarm::SwarmBuilder
76#[derive(Clone, Component, Default)]
77pub struct NoState;