update goal in new thread

This commit is contained in:
Leijurv 2018-09-24 10:17:01 -07:00
parent 4ec9a4fc5b
commit 5650c86a7d
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -21,11 +21,11 @@ import baritone.Baritone;
import baritone.api.behavior.IMineBehavior; import baritone.api.behavior.IMineBehavior;
import baritone.api.event.events.PathEvent; import baritone.api.event.events.PathEvent;
import baritone.api.event.events.TickEvent; import baritone.api.event.events.TickEvent;
import baritone.api.pathing.goals.Goal;
import baritone.cache.CachedChunk; import baritone.cache.CachedChunk;
import baritone.cache.ChunkPacker; import baritone.cache.ChunkPacker;
import baritone.cache.WorldProvider; import baritone.cache.WorldProvider;
import baritone.cache.WorldScanner; import baritone.cache.WorldScanner;
import baritone.api.pathing.goals.Goal;
import baritone.pathing.goals.GoalBlock; import baritone.pathing.goals.GoalBlock;
import baritone.pathing.goals.GoalComposite; import baritone.pathing.goals.GoalComposite;
import baritone.pathing.goals.GoalTwoBlocks; import baritone.pathing.goals.GoalTwoBlocks;
@ -78,7 +78,7 @@ public final class MineBehavior extends Behavior implements IMineBehavior, Helpe
int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get(); int mineGoalUpdateInterval = Baritone.settings().mineGoalUpdateInterval.get();
if (mineGoalUpdateInterval != 0) { if (mineGoalUpdateInterval != 0) {
if (event.getCount() % mineGoalUpdateInterval == 0) { if (event.getCount() % mineGoalUpdateInterval == 0) {
updateGoal(); Baritone.INSTANCE.getExecutor().execute(this::updateGoal);
} }
} }
PathingBehavior.INSTANCE.revalidateGoal(); PathingBehavior.INSTANCE.revalidateGoal();