Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritize path, then new chunks in work queue. Purge old chunks #4057

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move cull code
  • Loading branch information
ZeroMemes committed Jul 16, 2023
commit 19b66903d0e4f787f669ecf94c49ca2abc54f1a7
14 changes: 6 additions & 8 deletions src/main/java/baritone/behavior/ElytraBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,6 @@ public void onTick(final TickEvent event) {
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) {
Expand Down Expand Up @@ -597,6 +589,12 @@ public void onTick(final TickEvent event) {
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;
}
}

/**
Expand Down