Considerations

This commit is contained in:
Brady 2023-06-28 01:04:08 -05:00
parent 7a61ab8137
commit bb39fea415
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 7 additions and 0 deletions

View File

@ -459,6 +459,10 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
* Called by {@link ElytraProcess#onTick(boolean, boolean)} when the process is in control and the player is flying * Called by {@link ElytraProcess#onTick(boolean, boolean)} when the process is in control and the player is flying
*/ */
private void tick() { private void tick() {
if (this.pathManager.getPath().isEmpty()) {
return;
}
if (ctx.player().collidedHorizontally) { if (ctx.player().collidedHorizontally) {
logDirect("hbonk"); logDirect("hbonk");
} }
@ -506,6 +510,9 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
// changed. Updating it now will avoid unnecessary recalculation on the main thread. // changed. Updating it now will avoid unnecessary recalculation on the main thread.
this.pathManager.updatePlayerNear(); this.pathManager.updatePlayerNear();
// TODO: If we used a firework at the end of the last tick, then it's worth it to solve with the assumption
// that we'll be boosted next tick (if our ping to the server is less than 50ms) since a recalc won't
// be needed on the main thread.
final SolverContext context = this.new SolverContext(true); final SolverContext context = this.new SolverContext(true);
this.solver = CompletableFuture.supplyAsync(() -> this.solveAngles(context)); this.solver = CompletableFuture.supplyAsync(() -> this.solveAngles(context));
this.solveNextTick = false; this.solveNextTick = false;