add path splice option
This commit is contained in:
parent
7d9b8ee4f3
commit
b338dcc9de
@ -572,6 +572,16 @@ public final class Settings {
|
|||||||
*/
|
*/
|
||||||
public final Setting<Boolean> walkWhileBreaking = new Setting<>(true);
|
public final Setting<Boolean> walkWhileBreaking = new Setting<>(true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When a new segment is calculated that doesn't overlap with the current one, but simply begins where the current segment ends,
|
||||||
|
* splice it on and make a longer combined path. If this setting is off, any planned segment will not be spliced and will instead
|
||||||
|
* be the "next path" in PathingBehavior, and will only start after this one ends. Turning this off hurts planning ahead,
|
||||||
|
* because the next segment will exist even if it's very short.
|
||||||
|
*
|
||||||
|
* @see #planningTickLookahead
|
||||||
|
*/
|
||||||
|
public final Setting<Boolean> splicePath = new Setting<>(true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If we are more than 300 movements into the current path, discard the oldest segments, as they are no longer useful
|
* If we are more than 300 movements into the current path, discard the oldest segments, as they are no longer useful
|
||||||
*/
|
*/
|
||||||
|
@ -195,7 +195,9 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
|
|||||||
current.onTick();
|
current.onTick();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
current = current.trySplice(next);
|
if (Baritone.settings().splicePath.value) {
|
||||||
|
current = current.trySplice(next);
|
||||||
|
}
|
||||||
if (next != null && current.getPath().getDest().equals(next.getPath().getDest())) {
|
if (next != null && current.getPath().getDest().equals(next.getPath().getDest())) {
|
||||||
next = null;
|
next = null;
|
||||||
}
|
}
|
||||||
|
@ -610,7 +610,7 @@ public class PathExecutor implements IPathExecutor, Helper {
|
|||||||
ret.costEstimateIndex = costEstimateIndex;
|
ret.costEstimateIndex = costEstimateIndex;
|
||||||
ret.ticksOnCurrent = ticksOnCurrent;
|
ret.ticksOnCurrent = ticksOnCurrent;
|
||||||
return ret;
|
return ret;
|
||||||
}).orElse(cutIfTooLong());
|
}).orElseGet(this::cutIfTooLong); // dont actually call cutIfTooLong every tick if we won't actually use it, use a method reference
|
||||||
}
|
}
|
||||||
|
|
||||||
private PathExecutor cutIfTooLong() {
|
private PathExecutor cutIfTooLong() {
|
||||||
|
Loading…
Reference in New Issue
Block a user