Remove unnecessary conversions to Vec3d

This commit is contained in:
Brady 2023-06-20 20:18:56 -05:00
parent 7a12ef530c
commit fa158c6e67
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
final long start = System.nanoTime();
this.path0(ctx.playerFeet(), destination, UnaryOperator.identity())
.thenRun(() -> {
final double distance = this.pathAt(0).distanceTo(this.pathAt(this.path.size() - 1));
final double distance = this.path.get(0).distanceTo(this.path.get(this.path.size() - 1));
if (this.completePath) {
logDirect(String.format("Computed path (%.1f blocks in %.4f seconds)", distance, (System.nanoTime() - start) / 1e9d));
} else {
@ -157,7 +157,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
this.path0(this.path.get(afterIncl), this.destination, segment -> segment.prepend(before.stream()))
.thenRun(() -> {
final int recompute = this.path.size() - before.size() - 1;
final double distance = this.pathAt(0).distanceTo(this.pathAt(recompute));
final double distance = this.path.get(0).distanceTo(this.path.get(recompute));
if (this.completePath) {
logDirect(String.format("Computed path (%.1f blocks in %.4f seconds)", distance, (System.nanoTime() - start) / 1e9d));