mineGoalUpdateInterval and cancelOnGoalInvalidation
This commit is contained in:
parent
b5a512963d
commit
a978ddec08
@ -327,6 +327,17 @@ public class Settings {
|
|||||||
*/
|
*/
|
||||||
public Setting<Boolean> walkWhileBreaking = new Setting<>(true);
|
public Setting<Boolean> walkWhileBreaking = new Setting<>(true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rescan for the goal once every 5 ticks.
|
||||||
|
* Set to 0 to disable.
|
||||||
|
*/
|
||||||
|
public Setting<Integer> mineGoalUpdateInterval = new Setting<>(5);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancel the current path if the goal has changed, and the path originally ended in the goal but doesn't anymore
|
||||||
|
*/
|
||||||
|
public Setting<Boolean> cancelOnGoalInvalidation = new Setting<>(true);
|
||||||
|
|
||||||
public final Map<String, Setting<?>> byLowerName;
|
public final Map<String, Setting<?>> byLowerName;
|
||||||
public final List<Setting<?>> allSettings;
|
public final List<Setting<?>> allSettings;
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
package baritone.behavior;
|
package baritone.behavior;
|
||||||
|
|
||||||
|
import baritone.Baritone;
|
||||||
import baritone.api.behavior.Behavior;
|
import baritone.api.behavior.Behavior;
|
||||||
import baritone.api.event.events.PathEvent;
|
import baritone.api.event.events.PathEvent;
|
||||||
import baritone.api.event.events.TickEvent;
|
import baritone.api.event.events.TickEvent;
|
||||||
@ -56,8 +57,14 @@ public final class MineBehavior extends Behavior implements Helper {
|
|||||||
if (mining == null) {
|
if (mining == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event.getCount() % 5 == 0) {
|
int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get();
|
||||||
updateGoal();
|
if (mineGoalUpdateInterval != 0) {
|
||||||
|
if (event.getCount() % mineGoalUpdateInterval == 0) {
|
||||||
|
updateGoal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!Baritone.settings().cancelOnGoalInvalidation.get()) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
Optional<IPath> path = PathingBehavior.INSTANCE.getPath();
|
Optional<IPath> path = PathingBehavior.INSTANCE.getPath();
|
||||||
if (!path.isPresent()) {
|
if (!path.isPresent()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user