#[non_exhaustive]pub struct Config {
pub sprint: bool,
pub parkour: bool,
pub max_fall: f64,
pub max_water_fall: f64,
pub swim: bool,
pub climb: bool,
pub dig: Option<DigCost>,
pub place: Option<f64>,
pub max_nodes: usize,
pub heuristic_weight: f64,
/* private fields */
}Expand description
Planner options. Build with Config::default and the with_* methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.sprint: boolSprint on straight runs (costs assume sprinting; needs food > 6). Default on.
parkour: boolJump over gaps: up to 3 blocks on the level, onto a block one higher or up to two lower, each only where the vanilla-exact physics lands the jump (some need sprinting). Default on.
max_fall: f64Highest drop onto a floor, in blocks (3 = no fall damage). Default 3.
max_water_fall: f64Highest drop into water at least 2 blocks deep. Default 16.
swim: boolSwim. Default on.
climb: boolClimb ladders and vines. Default on.
dig: Option<DigCost>Dig through blocks in the way (default off): tunnels, jump-ups into dug space,
straight down (MoveKind::DigDown) and staircases down (a MoveKind::Descend
with digs). The follower digs with the held item.
place: Option<f64>Place blocks, at this cost in ticks per block (default off): fill a one-deep hole, bridge over a gap (sneaking to the edge, placing against the side of the floor block), tower straight up (jump, place under the feet). The follower places the held item: the caller keeps blocks in hand.
max_nodes: usizeNode budget per plan; when exhausted the best partial path is returned. Default 250 000: enough to search all the terrain a client loads at view distance 10 on a flat world (a maze whose way is far longer than the straight line needs that); at most some 30–40 MB while it runs and half a second of one desktop core.
heuristic_weight: f64Heuristic weight (1 = optimal; larger plans faster, slightly longer paths).
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_sprint(self, on: bool) -> Self
pub fn with_sprint(self, on: bool) -> Self
Sprinting on or off.
Sourcepub fn with_parkour(self, on: bool) -> Self
pub fn with_parkour(self, on: bool) -> Self
Gap jumps on or off.
Sourcepub fn with_max_fall(self, blocks: f64) -> Self
pub fn with_max_fall(self, blocks: f64) -> Self
Highest drop onto a floor.
Sourcepub fn with_climb(self, on: bool) -> Self
pub fn with_climb(self, on: bool) -> Self
Climbing on or off.
Sourcepub fn with_place(self, cost: Option<f64>) -> Self
pub fn with_place(self, cost: Option<f64>) -> Self
Placing blocks: filling holes, bridging, towering up (cost in ticks per block; None = off).
Sourcepub fn with_max_nodes(self, n: usize) -> Self
pub fn with_max_nodes(self, n: usize) -> Self
Node budget.
Sourcepub fn with_heuristic_weight(self, w: f64) -> Self
pub fn with_heuristic_weight(self, w: f64) -> Self
Heuristic weight (>= 1).