1
0
mirror of https://github.com/cabaletta/baritone synced 2024-12-17 20:55:09 +00:00

move cull code

This commit is contained in:
Brady 2023-07-16 18:58:13 -05:00
parent 839ddaf85e
commit 19b66903d0
No known key found for this signature in database
GPG Key ID: 73A788379A197567

View File

@ -519,14 +519,6 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
return;
}
if (this.context != null && this.boi != null) {
final long now = System.currentTimeMillis();
if ((now - this.timeLastCacheCull) / 1000 > Baritone.settings().elytraTimeBetweenCacheCullSecs.value) {
this.context.queueCacheCulling(ctx.player().chunkCoordX, ctx.player().chunkCoordZ, Baritone.settings().elytraCacheCullDistance.value, this.boi);
this.timeLastCacheCull = now;
}
}
// Fetch the previous solution, regardless of if it's going to be used
this.pendingSolution = null;
if (this.solver != null) {
@ -597,6 +589,12 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
Math.max(playerNear - 30, 0),
Math.min(playerNear + 100, path.size())
);
final long now = System.currentTimeMillis();
if ((now - this.timeLastCacheCull) / 1000 > Baritone.settings().elytraTimeBetweenCacheCullSecs.value) {
this.context.queueCacheCulling(ctx.player().chunkCoordX, ctx.player().chunkCoordZ, Baritone.settings().elytraCacheCullDistance.value, this.boi);
this.timeLastCacheCull = now;
}
}
/**