Merge pull request #2015 from babbaj/fix-troll-code

Don't call onLostControl on processes that haven't been fully constructed
This commit is contained in:
Brady 2020-09-13 17:46:23 -05:00 committed by GitHub
commit 500c34c330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -104,14 +104,14 @@ public class Baritone implements IBaritone {
this.pathingControlManager = new PathingControlManager(this); this.pathingControlManager = new PathingControlManager(this);
{ {
followProcess = new FollowProcess(this); this.pathingControlManager.registerProcess(followProcess = new FollowProcess(this));
mineProcess = new MineProcess(this); this.pathingControlManager.registerProcess(mineProcess = new MineProcess(this));
customGoalProcess = new CustomGoalProcess(this); // very high iq this.pathingControlManager.registerProcess(customGoalProcess = new CustomGoalProcess(this)); // very high iq
getToBlockProcess = new GetToBlockProcess(this); this.pathingControlManager.registerProcess(getToBlockProcess = new GetToBlockProcess(this));
builderProcess = new BuilderProcess(this); this.pathingControlManager.registerProcess(builderProcess = new BuilderProcess(this));
exploreProcess = new ExploreProcess(this); this.pathingControlManager.registerProcess(exploreProcess = new ExploreProcess(this));
backfillProcess = new BackfillProcess(this); this.pathingControlManager.registerProcess(backfillProcess = new BackfillProcess(this));
farmProcess = new FarmProcess(this); this.pathingControlManager.registerProcess(farmProcess = new FarmProcess(this));
} }
this.worldProvider = new WorldProvider(); this.worldProvider = new WorldProvider();

View File

@ -30,7 +30,6 @@ public abstract class BaritoneProcessHelper implements IBaritoneProcess, Helper
public BaritoneProcessHelper(Baritone baritone) { public BaritoneProcessHelper(Baritone baritone) {
this.baritone = baritone; this.baritone = baritone;
this.ctx = baritone.getPlayerContext(); this.ctx = baritone.getPlayerContext();
baritone.getPathingControlManager().registerProcess(this);
} }
@Override @Override