load boundary cutoff setting

This commit is contained in:
Leijurv 2018-08-19 11:45:50 -07:00
parent d3bd6ae843
commit 922671c77d
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 8 additions and 3 deletions

View File

@ -51,6 +51,7 @@ public class Settings {
public Setting<Boolean> backtrackCostFavor = new Setting<>(true); // see issue #18
public Setting<Double> backtrackCostFavoringCoefficient = new Setting<>(0.9); // see issue #18
public Setting<Boolean> minimumImprovementRepropagation = new Setting<>(true);
public Setting<Boolean> cutoffAtLoadBoundary = new Setting<>(true);
public Setting<Number> pathTimeoutMS = new Setting<>(4000L);

View File

@ -201,13 +201,17 @@ public class PathingBehavior extends Behavior {
displayChatMessageRaw("Starting to search for path from " + start + " to " + goal);
}
findPath(start, previous).map(IPath::cutoffAtLoadedChunks).map(PathExecutor::new).ifPresent(path -> {
Optional<IPath> path = findPath(start, previous);
if (Baritone.settings().cutoffAtLoadBoundary.get()) {
path = path.map(IPath::cutoffAtLoadedChunks);
}
path.map(PathExecutor::new).ifPresent(p -> {
synchronized (pathPlanLock) {
if (current == null) {
current = path;
current = p;
} else {
if (next == null) {
next = path;
next = p;
} else {
throw new IllegalStateException("I have no idea what to do with this path");
}