From 32ef30686bc1504ccf67c9cdb8308161c3f37b3a Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 13 Sep 2020 18:21:22 -0400 Subject: [PATCH] Don't call onLostControl on processes that haven't been fully constructed --- src/main/java/baritone/Baritone.java | 16 ++++++++-------- .../baritone/utils/BaritoneProcessHelper.java | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/baritone/Baritone.java b/src/main/java/baritone/Baritone.java index 360a17fd..32302287 100755 --- a/src/main/java/baritone/Baritone.java +++ b/src/main/java/baritone/Baritone.java @@ -104,14 +104,14 @@ public class Baritone implements IBaritone { this.pathingControlManager = new PathingControlManager(this); { - followProcess = new FollowProcess(this); - mineProcess = new MineProcess(this); - customGoalProcess = new CustomGoalProcess(this); // very high iq - getToBlockProcess = new GetToBlockProcess(this); - builderProcess = new BuilderProcess(this); - exploreProcess = new ExploreProcess(this); - backfillProcess = new BackfillProcess(this); - farmProcess = new FarmProcess(this); + this.getPathingControlManager().registerProcess(followProcess = new FollowProcess(this)); + this.getPathingControlManager().registerProcess(mineProcess = new MineProcess(this)); + this.getPathingControlManager().registerProcess(customGoalProcess = new CustomGoalProcess(this)); // very high iq + this.getPathingControlManager().registerProcess(getToBlockProcess = new GetToBlockProcess(this)); + this.getPathingControlManager().registerProcess(builderProcess = new BuilderProcess(this)); + this.getPathingControlManager().registerProcess(exploreProcess = new ExploreProcess(this)); + this.getPathingControlManager().registerProcess(backfillProcess = new BackfillProcess(this)); + this.getPathingControlManager().registerProcess(farmProcess = new FarmProcess(this)); } this.worldProvider = new WorldProvider(); diff --git a/src/main/java/baritone/utils/BaritoneProcessHelper.java b/src/main/java/baritone/utils/BaritoneProcessHelper.java index 6abec949..e9ce1273 100644 --- a/src/main/java/baritone/utils/BaritoneProcessHelper.java +++ b/src/main/java/baritone/utils/BaritoneProcessHelper.java @@ -30,7 +30,6 @@ public abstract class BaritoneProcessHelper implements IBaritoneProcess, Helper public BaritoneProcessHelper(Baritone baritone) { this.baritone = baritone; this.ctx = baritone.getPlayerContext(); - baritone.getPathingControlManager().registerProcess(this); } @Override