1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Physics-exact path planning and following for the ghast Minecraft Java Edition bot library.
//!
//! - [`Pathfinder`]: A* over feet blocks. Moves: walk (incl. step-ups onto slabs and partial
//! blocks), diagonal, jump up, drop down (configurable maximum fall), 1- and 2-block gap
//! jumps, swimming, ladder / vine climbing, and optionally digging and placing. Costs are
//! ticks **measured with `ghast-physics`** (see [`Costs`]). Unknown (unloaded) blocks are
//! never treated as air: they are impassable, and a goal beyond them yields a partial path.
//! - [`Controller`]: turns a path into per-tick keys and aim. It picks the keys by simulating
//! the vanilla-exact physics one tick ahead, and turns in whole mouse counts exactly like the
//! client does, so a simulated run and a live run make the same decisions.
//! - [`simulate`]: runs a path with the controller in `ghast-physics`; the validation tests use
//! it to check every move type on random terrain, and [`Pathfinder::plan_verified`] uses it
//! to repair a plan before the bot moves.
//! - `Follower` (feature `client`, default): a `ghast_client::Behavior` helper that plans,
//! follows, replans on deviations, teleports and blocked moves, all through `TickContext`.
//!
//! ```
//! use ghast_pathfinder::{Config, Goal, Pathfinder, Version};
//!
//! let mut world = ghast_physics::v1_8::memory_world();
//! world.load_chunks(-2, -2, 2, 2);
//! world.fill_raw([-20, 63, -20], [20, 63, 20], 1 << 4); // stone floor
//! world.fill_raw([3, 64, -5], [3, 64, 5], 1 << 4); // a low wall to jump over
//! let pf = Pathfinder::new(Config::default());
//! let path = pf.plan(Version::V1_8, &world, [0, 64, 0], &Goal::Block([8, 64, 0])).unwrap();
//! assert!(!path.partial);
//! assert_eq!(path.steps.last().unwrap().pos, [8, 64, 0]);
//! ```
pub use ;
pub use Costs;
pub use ;
pub use Goal;
pub use ;
pub use Observation;
pub use ;
pub use ;
pub use BlockSource;
/// The protocol version whose blocks and physics a plan uses.