recompute on change

This commit is contained in:
Leijurv 2023-08-13 19:29:19 -07:00
parent f331124895
commit 4e3a7abac9
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,7 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
private boolean reachedGoal; // this basically just prevents potential notification spam
private Goal goal;
private ElytraBehavior behavior;
private boolean predictingTerrain;
private ElytraProcess(Baritone baritone) {
super(baritone);
@ -97,6 +98,11 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
logDirect("Nether seed changed, recalculating path");
this.resetState();
}
if (predictingTerrain != Baritone.settings().elytraPredictTerrain.value) {
logDirect("elytraPredictTerrain setting changed, recalculating path");
predictingTerrain = Baritone.settings().elytraPredictTerrain.value;
this.resetState();
}
this.behavior.onTick();
@ -300,6 +306,7 @@ public class ElytraProcess extends BaritoneProcessHelper implements IBaritonePro
return;
}
this.onLostControl();
this.predictingTerrain = Baritone.settings().elytraPredictTerrain.value;
this.behavior = new ElytraBehavior(this.baritone, this, destination, appendDestination);
if (ctx.world() != null) {
this.behavior.repackChunks();