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);
|
||||
|
||||
/**
|
||||
* 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 List<Setting<?>> allSettings;
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
package baritone.behavior;
|
||||
|
||||
import baritone.Baritone;
|
||||
import baritone.api.behavior.Behavior;
|
||||
import baritone.api.event.events.PathEvent;
|
||||
import baritone.api.event.events.TickEvent;
|
||||
@ -56,9 +57,15 @@ public final class MineBehavior extends Behavior implements Helper {
|
||||
if (mining == null) {
|
||||
return;
|
||||
}
|
||||
if (event.getCount() % 5 == 0) {
|
||||
int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get();
|
||||
if (mineGoalUpdateInterval != 0) {
|
||||
if (event.getCount() % mineGoalUpdateInterval == 0) {
|
||||
updateGoal();
|
||||
}
|
||||
}
|
||||
if (!Baritone.settings().cancelOnGoalInvalidation.get()) {
|
||||
return;
|
||||
}
|
||||
Optional<IPath> path = PathingBehavior.INSTANCE.getPath();
|
||||
if (!path.isPresent()) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user